I'm struggling to migrate / move my Docker Compoe project with Wordpress and Mysql to a new host.
My docker-compoye.yaml
is as follows:
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8099:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: 'ahw5ai8gu9waewiuNgaithev7xie0jah'
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DEBUG: 1
depends_on:
- db
volumes:
- .wordpress/plugins:/var/www/html/wp-content/plugins
- .wordpress/themes:/var/www/html/wp-content/themes
- .wordpress/uploads:/var/www/html/wp-content/uploads
- ./wordpress.ini:/usr/local/etc/php/conf.d/wordpress.ini
db:
image: mysql:5.7
restart: always
ports:
- 3306:3306
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_ROOT_PASSWORD: ahw5ai8gu9waewiuNgaithev7xie0jah
volumes:
- .db:/var/lib/mysql
The directory structure is as follows:
drwxrwxr-x 8 999 mbecker 4,0K Mär 5 09:36 .db
-rwxrwxr-x 1 mbecker mbecker 2,5K Mär 2 16:39 docker-compose.yaml
drwxrwxrwx 6 mbecker mbecker 4,0K Apr 11 2021 .wordpress
I have done the following migration strategies to copy the complete directory / files to new host:
- rsync the complete directory (and subdirectory) to the new hist
- create a .tar of the local directory recursive, move to the new host, and extract it
However, the file permission for example in the volume / directory path .wordpress/plugins/
changed from www-data
to mbecker
.
Starting the docker compose project on the new host results in the following Wordpress error:
Notice: Function WP_User_Query::query was called incorrectly. User queries should not be run before the plugins_loaded hook. Please see Debugging in WordPress for more information. (This message was added in version 6.1.1.) in /var/www/html/wp-includes/functions.php on line 5835
** The database data is imported correctly via import script
** The DNS names are pointed to the new IP and the Nginx reverse proxy directive is the same
Any ideas how to move the data from one host to another with correct file permission?