How to properly import a site into V4?

I backed up my WP site and now i want to import it into a clean V4.

How do i properly do this? I keep getting all kinds of file/folder permission errors after i copy over the files.

Follow this article.

Hope it helps

thanks. that worked mostly.

the command line way to import the sql file didn’t work. but luckly importing the database through phpmyadmin worked fine.

It works fine but you need to mention the container Id of the Maria DB container.

which i would get from where? im quite new to docker

If you want to import a WordPress sql file, then move it to the site’s htdocs volume then execute wp cli import command:

# must be ran as sudo or root
mv /path/to/wp.sql /opt/easyengine/sites/yourdomain.com/app/htdocs
ee shell yourdomain.com --command="wp db import wp.sql"
rm /opt/easyengine/sites/yourdomain.com/app/htdocs/wp.sql
1 Like

By using the command as given below:
docker container ls

For restoring or importing SQL backup, replace CONTAINER by container ID of Maria DB.

thank you. this worked

i ran the code you give but i just end up getting a list of usage commands for mysql.

is DATABASE the name of the database i’m importing into which i can get from ee site info?

No. You can find name of the database, database user name and password by using ee site info domain.com

WP CLI commands also works fine as suggested by @cim
However, I prefer dealing directly with containers. Nothing wrong in using WP CLI if it works fine and saves your time and effort.

im just not grasping it. can you show me a made up example? im going to try to use it on a non-wordpress site. thanks

This would be a lot easier if you don’t want to play around with the CLI:

cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root –password=root DATABASE

replace backup.sql by path to your sql file. CONTAINER by maria db container id, root by database username, password=root by password=database password and DATABASE by database name.