Unable to retrieve the PostgreSQL database after attaching EBS volume to new EC2 Instance

164 Views Asked by At

I have an EC2 instance with Root(/dev/xvda) and EBS(/dev/xvdb)volumes. Both are mounted.

I have installed PostgreSQL DB and inserted some data in it, then I have created a snapshot of EBS(/dev/xvdb)volume and then from this I have created a volume.

Now I have stopped my EC2 instance, and created a new EC2 instance with root volume and attached the old volume(/dev/xvdb) to this new instance.

Now, I have both root and EBS(/dev/xvdf). Both are mounted at / and /data directories.

I have installed PostgreSQL DB in my root volume, and now I can see the PostgreSQL data directory in new EC2 instance at /data directory, but when I enter into PostgreSQL shell and look for databases, I cannot see the database which was created in /dev/xvdb volume.

Can anyone help?

Thanks in advance.

0

There are 0 best solutions below