Separate app and data into a different volume

Keywords: WordPress - AWS - Technical issue - Other
Description:
Hi,

I have an AWS instance running Bitnami wordpress AMI, and I’d like to move the app and data out to a different volume. Can you help me with some guideline to do that? I know already how to create a new volume and attach it to the instance in AWS, but what I don’t know is how to make the app and data move and work from the new volume.

Thanks in advance.
Pablo.-

Hi @pcorrenti,

You only need to move the installation directory to the new volume and then create a symlink to that new path.

# Stop the services
sudo /opt/bitnami/ctlscript.sh stop

# Move the data
sudo mv /opt/bitnami /your/new/disk/bitnami

# Create the symlink
sudo ln -sf /your/new/disk/bitnami /opt/bitnami

# Start the services
sudo /opt/bitnami/ctlscript.sh start

Happy to help!


Was my answer helpful? Click on :heart:

1 Like

Hi @jota,

Excellent, thanks a lot. It worked great.

Best regards,
Pablo.-

1 Like

Hi @jota,

Related to this topic, I’ve created a another instance with the new Bitnami Wordpress AMI, and I’d like to attach the EBS volume that already includes the app and data. I’ve already attached the EBS volume to the instance in the AWS console, created the /data directory and mount the volume on it, but could linked it. Can you help me with that?

I’ve tried with the command sudo ln -sf /data/bitnami /opt/bitnami, but didn’t work…

Thanks in advance,
Pablo.-

Hi @pcorrenti,

Can you tell us which error message are you getting? I guess it is because the /opt/bitnami in the new instance is already populated or linked. Did you follow the same steps that Jota mentioned previously and that worked for you?

Hi @gongomgra,

As I have the volume already created and attached to the instance, and with the data already uploaded to the /data/bitnami directory, I just executed the command sudo ln -sf /data/bitnami /opt/bitnami to create the symlink. I didn´t run the first command for moving the data. (being “/data” the directory where the new disk is mounted.)

Actually I haven’t got any error message, it is just that I can’t visualize website. It shows just the Hello World page.

What else can I do?

Thanks,
Pablo.-

Let’s get more information about your configuration. Can you run this command to verify that the symlink was created properly?

sudo ls -la /opt/bitnami

Apart from that, we have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Hi @jota

Thanks for your reply. Below the result of the command:

And here is the bn support tool code: 7e03fe9d-1c57-374c-b7a8-99f06bd08266

Just to explaiin with more detail my goal. At the end I’d like to have a volume with the app and data that I can use with different instances. So I just backup the volume daily, and in case of any problem with the server, just launch a new instance and attach the volume containing the app and the up to date data.

Thanks for your help,
Pablo.-

Hi @pcorrenti,

It seems you didn’t remove the existing /opt/bitnami folder in the new instance and that’s why you can’t create the symbolic link and start the services with your data. Please run these commands and post the output here.

sudo /opt/bitnami/ctlscript.sh stop
sudo mv /opt/bitnami /opt/bitnami.back
sudo ln -sf /data/bitnami /opt/bitnami
sudo /opt/bitnami/ctlscript.sh start

Hi @jota,

I run the first 3 commands succesfully, but the services doesn’t start with the 4th one. It just keep waiting… Here the outcome of the command to verify the symlink:

image

It seems it can’t find where the files are now. Because I’ve tried to run the bn support tool, and didn’t find it either.

image

image

What else could we try?

Thanks,
Pablo.-

Hi @pcorrenti,

What’s the content of the /data/bitnami folder?

sudo ls -la /data
sudo ls -la /data/bitnami

Hi @jota,

Please find below the results of the commands:

image

Thanks,
Pablo.-

Hi @pcorrenti,

Basically, it seems that the bnsupport-tool was not properly copied to the disk you attached to the instance. However, you can run these commands to download the latest version

cd /tmp
wget -O bnsupport-linux-x64.run https://downloads.bitnami.com/files/bnsupport/latest/bnsupport-linux-x64.run
sudo mkdir /opt/bitnami/bnsupport
sudo mv bnsupport-linux-x64.run /opt/bitnami/bnsupport/
sudo chmod +x /opt/bitnami/bnsupport/bnsupport-linux-x64.run
sudo ln -s /opt/bitnami/bnsupport/bnsupport-linux-x64.run /opt/bitnami/bnsupport-tool

https://docs.bitnami.com/aws/how-to/understand-bnsupport/

Hi @jota,

Thanks for your reply. I think I’ll put this on hold until I can solve the performance issues I’m having with the new Bitnami Wordpress AMI in this open topic (New Wordpress AMI comsume too much server resources - WordPress - Bitnami Community). I will come back to this as soon as I can.

Regards,
Pablo.-

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.