Recreate WP website from .SQL and .ZIP files #1698
-
Hello! I have a .SQL export of WP DB and a .ZIP container with WP files. I have created a website with ee site create --wp, but I don't know how to manage the backup files to overwrite the ee created site files. Can you help me with this? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Normally you just unzip the wp-content folder onto the existing wp-content folder, overwriting the existing folders, and make sure that all the ownerships and permissions are set correctly. The sql file is moved into the wp directory and imported with the 'wp db import' command. Your wp-content folder lives in the sites htdocs folder. On EE4 you can find this folder in /opt/easyengine/sites/mysite.com/app/htdocs. This is the linked file, so understand that you will find other documentation that references the actual docker volume location of the file as /var/lib/docker/volumes/mysitecom_htdocs/_data/htdocs. They are both the same so use whichever is easier for you to remember. Personally I reference everything EE inside the /opt/easyengine/sites folder structures as I find it easy to remember. Once you have moved the wp-content folder inside the htdocs folder (don't worry about overwriting any of the default data in that folder) you just need to make sure to set ownership. 'sudo chown -R www-data:www-data htdocs/' For the database, you have to move the file into the htdocs folder first. Then chown to www-data as above but substituting the name of the sql file for the wp-content folder name. To import the database you have to get to the shell for your site - 'sudo ee shell mysite.com' and then import the db with 'wp db import mysite.sql' All other aspects such as DNS and SSL being properly set, you should have your site up and running. Housekeeping notes: mysite.com should be changed to whatever your site's name is that you used and if your backup zip of your old site encompasses more then just the wp-content folder, ignore all but that folder. |
Beta Was this translation helpful? Give feedback.
-
Thank you, @freedog96150 ! |
Beta Was this translation helpful? Give feedback.
Normally you just unzip the wp-content folder onto the existing wp-content folder, overwriting the existing folders, and make sure that all the ownerships and permissions are set correctly. The sql file is moved into the wp directory and imported with the 'wp db import' command.
Your wp-content folder lives in the sites htdocs folder. On EE4 you can find this folder in /opt/easyengine/sites/mysite.com/app/htdocs. This is the linked file, so understand that you will find other documentation that references the actual docker volume location of the file as /var/lib/docker/volumes/mysitecom_htdocs/_data/htdocs. They are both the same so use whichever is easier for you to remember. Personally …