Need help migrating the installation from SD card to USB stick while the main data drive remains the same

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 22.1.1
Operating system and version: Ubuntu 21.04
Apache or nginx version: Apache 2.4.45
PHP version : 8.0.10

The issue you are facing:

I have a RaspberryPi using SD card for boot. It is small and I want to upgrade it to a larger usb stick. I use docker to run nextcloud. The /var/www/html/data volume is linked to an external HDD drive. I want the drive to remain, I am only swaping the SD card.

I cannot figure out how to create new nextcloud container on the USB such that I can access the data on the drive. If I try to use creadentials from the SD card I get an error that such user already exists. I presume there is some folder that should be copied from one container to another but I can’t figure out which one.

I am using MariaDB and I have tried making a backup using SD card and restoring using the USB stick but it didn’t work.

I still have the SD card working. If I use it to boot everything works.

The output of your config.php file in /path/to/nextcloud

$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  '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,
  'overwriteprotocol' => 'https',
  'passwordsalt' => '[XxX SENSIBLE CONTENT REMOVED BY MOD/JK XxX]',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'password',
  'installed' => true,

pls take care to not provide any sensible data in the future… so pls regard your instance as compromised from now on unless you’re gonna fix the referring data