Replies: 1 comment
-
|
Hi @bdkoder thanks for the question. So we you have a bunch of different paths of action here. Regarding THE BACKUP:
phpmyadmin:
container_name: "php-my-admin"
depends_on:
- "db"
image: phpmyadmin/phpmyadmin
ports:
- "8081:80"
environment:
PMA_HOST: dbThen you can access to the php-my-admin interface at the localhost, port 8081.
docker-compose exec db bash -c 'mysqldump -u root -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" --skip-comments' > database-backup.sqlYou should see the file Beware that no matter the approach you choose, if you need to use this backup in production you will probably need to change some local values like the "host" and the "siteurl" values inside the `wp_options" table (when you work here they will be setted to "localhost:port_num"). As for RESTORING THE DB: Basically you can remove the volumes either with As for the PHP version: FROM wordpress:php8.1-apachePossible values could be found on the wordpress docker image tags: https://hub.docker.com/_/wordpress/tags docker image rm fsg/wordpress:latest
docker-compose up --build |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I backup & restore the database? And is it possible to change PHP version as wish?
Beta Was this translation helpful? Give feedback.
All reactions