How do I restore? Did not run backup command, but have backup of root drive

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com 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:

example

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

longer
example
here

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 (eg, 20.0.5): 26.0.0
Operating system and version (eg, Ubuntu 20.04): 20.04.06
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): Not sure

The issue you are facing:
Failed to properly backup my Nextcloud. Looking for a solution to restore it in a new linux install.

Ran the rsync command to back up my entire root folder / to a backup path /backup. That made a copy of all my documents and files. Then I discovered that I needed to run a specific command to have the Nextcloud server generate a backup file for restoring in a new machine.

Now I have a fresh install of linux and all my Nextcloud data in a backup. I tried to rsync from /backup to / but it ends up bugging out my linux installation.

Might anyone know the specific steps and/or folders that need to be migrated in order to get my old Nextcloud running? if just to run the proper backup command.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. rsync -aAXv /Linunx_backup / - corrupted my linux installation.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'instanceid' => 'ockrmqljkwvr',
  'passwordsalt' => 'xxxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.yelsin.lol',
    1 => '192.168.1.172',
    2 => 'localhost',
    3 => 'http://nextcloud.yelsin.lol',
    4 => 'https://nextcloud.yelsin.lol',
  ),
  'datadirectory' => '/mnt/lvgroup-main/ncdata',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'overwrite.cli.url' => 'http://nextcloud.yelsin.lol',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxx',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'YelsinSepulveda',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'YelsinSepulveda@gmail.com',
  'mail_smtppassword' => 'xxxxxxxx',
  'app_install_overwrite' => 
  array (
    0 => 'printer',
  ),
  'loglevel' => 2,
);

Do not rsync the entire initial backup on the new server because you backed up the entire root dir. Mount the backup and restore the /var/www/NEXTCLOUD on the new server and try to locate the database and restore it to the new server. Once you have this files on the new server just follow the Nextcloud docs on how to restore Nextcloud or google it because there are tons of resources out there.

1 Like

The documentation tells you what to backup:
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html

and also how to restore:

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html

If you don’t give us more details, we can’t give you specific advice. It can be basic stuff like wrong permission settings or missing php modules.