From 915e7584b0870ccb0bfbfa9a0ee93db918659e06 Mon Sep 17 00:00:00 2001 From: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Sun, 24 Jan 2021 16:48:48 +0100 Subject: [PATCH 1/3] Make hierarchy of ordered list clearer by proper indenting Signed-off-by: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> --- README.md | 106 +++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 76d91af4..f4016dc5 100644 --- a/README.md +++ b/README.md @@ -462,73 +462,71 @@ You're already using Nextcloud and want to switch to docker? Great! Here are som 1. Define your whole Nextcloud infrastructure in a `docker-compose` file and run it with `docker-compose up -d` to get the base installation, volumes and database. Work from there. 2. Restore your database from a mysqldump (nextcloud\_db\_1 is the name of your db container) - - To import from a MySQL dump use the following commands + - To import from a MySQL dump use the following commands ```console docker cp ./database.dmp nextcloud_db_1:/dmp docker-compose exec db sh -c "mysql -u USER -pPASSWORD nextcloud < /dmp" docker-compose exec db rm /dmp ``` - - To import from a PostgreSQL dump use to following commands + - To import from a PostgreSQL dump use to following commands ```console docker cp ./database.dmp nextcloud_db_1:/dmp docker-compose exec db sh -c "psql -U USER --set ON_ERROR_STOP=on nextcloud < /dmp" docker-compose exec db rm /dmp ``` 3. Edit your config.php - 1. Set database connection - - In case of MySQL database - ```php - 'dbhost' => 'db:3306', - ``` - - In case of PostgreSQL database - ```php - 'dbhost' => 'db:5432', - ``` - 2. Make sure you have no configuration for the `apps_paths`. Delete lines like these - ```diff - - 'apps_paths' => array ( - - 0 => array ( - - 'path' => OC::$SERVERROOT.'/apps', - - 'url' => '/apps', - - 'writable' => true, - - ), - - ), - ``` - 3. Make sure to have the `apps` directory non writable and the `custom_apps` directory writable - ```php - 'apps_paths' => array ( - 0 => array ( - 'path' => '/var/www/html/apps', - 'url' => '/apps', - 'writable' => false, - ), - 1 => array ( - 'path' => '/var/www/html/custom_apps', - 'url' => '/custom_apps', - 'writable' => true, - ), - ), - ``` - 4. Make sure your data directory is set to /var/www/html/data - ```php - 'datadirectory' => '/var/www/html/data', - ``` - - + 1. Set database connection + - In case of MySQL database + ```php + 'dbhost' => 'db:3306', + ``` + - In case of PostgreSQL database + ```php + 'dbhost' => 'db:5432', + ``` + 2. Make sure you have no configuration for the `apps_paths`. Delete lines like these + ```diff + - 'apps_paths' => array ( + - 0 => array ( + - 'path' => OC::$SERVERROOT.'/apps', + - 'url' => '/apps', + - 'writable' => true, + - ), + - ), + ``` + 3. Make sure to have the `apps` directory non writable and the `custom_apps` directory writable + ```php + 'apps_paths' => array ( + 0 => array ( + 'path' => '/var/www/html/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => array ( + 'path' => '/var/www/html/custom_apps', + 'url' => '/custom_apps', + 'writable' => true, + ), + ), + ``` + 4. Make sure your data directory is set to /var/www/html/data + ```php + 'datadirectory' => '/var/www/html/data', + ``` 4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container): -```console -docker cp ./data/ nextcloud_app_1:/var/www/html/ -docker-compose exec app chown -R www-data:www-data /var/www/html/data -docker cp ./theming/ nextcloud_app_1:/var/www/html/ -docker-compose exec app chown -R www-data:www-data /var/www/html/theming -docker cp ./config/config.php nextcloud_app_1:/var/www/html/config -docker-compose exec app chown -R www-data:www-data /var/www/html/config -``` + ```console + docker cp ./data/ nextcloud_app_1:/var/www/html/ + docker-compose exec app chown -R www-data:www-data /var/www/html/data + docker cp ./theming/ nextcloud_app_1:/var/www/html/ + docker-compose exec app chown -R www-data:www-data /var/www/html/theming + docker cp ./config/config.php nextcloud_app_1:/var/www/html/config + docker-compose exec app chown -R www-data:www-data /var/www/html/config + ``` 5. Copy only the custom apps you use (or simply redownload them from the web interface): -```console -docker cp ./custom_apps/ nextcloud_data:/var/www/html/ -docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps -``` + ```console + docker cp ./custom_apps/ nextcloud_data:/var/www/html/ + docker-compose exec app chown -R www-data:www-data /var/www/html/custom_apps + ``` # Questions / Issues If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/nextcloud/docker) and write an issue. From d7e6260688347eb84ee401f82af76a14d975da73 Mon Sep 17 00:00:00 2001 From: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:00:44 +0100 Subject: [PATCH 2/3] Migration: Add info for copying data including its metadata Signed-off-by: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4016dc5..39991fb2 100644 --- a/README.md +++ b/README.md @@ -515,7 +515,7 @@ You're already using Nextcloud and want to switch to docker? Great! Here are som ``` 4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container): ```console - docker cp ./data/ nextcloud_app_1:/var/www/html/ + docker cp --preserve ./data/ nextcloud_app_1:/var/www/html/ docker-compose exec app chown -R www-data:www-data /var/www/html/data docker cp ./theming/ nextcloud_app_1:/var/www/html/ docker-compose exec app chown -R www-data:www-data /var/www/html/theming From 0d4148f9a490aa3177cb00d1037c4c868e00f64b Mon Sep 17 00:00:00 2001 From: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> Date: Sun, 24 Jan 2021 17:50:07 +0100 Subject: [PATCH 3/3] Migration: Clearer distinction between docker cp and system's cp Signed-off-by: Schroedingers-Cat <6382400+Schroedingers-Cat@users.noreply.github.com> --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39991fb2..b4d67db9 100644 --- a/README.md +++ b/README.md @@ -515,13 +515,17 @@ You're already using Nextcloud and want to switch to docker? Great! Here are som ``` 4. Copy your data (nextcloud_app_1 is the name of your Nextcloud container): ```console - docker cp --preserve ./data/ nextcloud_app_1:/var/www/html/ + docker cp ./data/ nextcloud_app_1:/var/www/html/ docker-compose exec app chown -R www-data:www-data /var/www/html/data docker cp ./theming/ nextcloud_app_1:/var/www/html/ docker-compose exec app chown -R www-data:www-data /var/www/html/theming docker cp ./config/config.php nextcloud_app_1:/var/www/html/config docker-compose exec app chown -R www-data:www-data /var/www/html/config ``` + If you want to preserve the metadata of your files like timestamps, copy the data directly on the host to the named volume using plain `cp` like this: + ```console + cp --preserve --recursive ./data/ /path/to/nextcloudVolume/data + ``` 5. Copy only the custom apps you use (or simply redownload them from the web interface): ```console docker cp ./custom_apps/ nextcloud_data:/var/www/html/