Copy SQL database between environments

Export the database

You first need to open up phpMyAdmin on the source environment by clicking the icon as shown below

05_open_in_browser_phpmyadmin.png

Export the database by first choosing the database to the left, in our case example, and then click on Export on the top navigation bar. Make sure to check the box where it says "Save on server in the directory /var/lib/jelastic/phpMyAdmin/save" and then click "Go".

06_export_database.png

Now you have exported the database.

Share folder between environments

Find the configuration wrench on the SQL Databases source node.

01_config_section.png

Go to folder /var/lib/jelastic/phpMyAdmin. Click the cogwheel on the save folder as shown on the image below and choose Export

02_find_export_menu.png

Make sure to choose the correct target container where your target SQL database is at.

03_choose_target.png

Make sure to use the path /var/lib/jelastic/phpMyAdmin/upload

04_set_target_path.png

Now the target environment should have access to a folder on the source environment.

Import the database

Open up phpMyAdmin on the target environment

07_target_phpmyadmin.png

In order to import the database, we need to create it beforehand as shown below.

08_create_schema.png

Since you have mounted the source environments save folder to the target environments upload folder, you have access to the sql files there. So click on "Select from the web server upload directory /var/lib/jelastic/phpMyAdmin/upload/" and click Go to import it.

09_choose_file.png

At this time, you should have a successful import.

Cleanup – Unmount the shared folder

When you are done exporting and importing databases, you should remove the shared folder. Click on the wrench on the target environments database node.

10_unmount_target1.png

You should see the upload folder in your *Mount Points folder below to the left. Click the cogwheel and unmount, as shown in the image below

11_unmount_target2.png

You should be all set!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.