Nc-restore seems to be stuck

Hi!
I want to upgrade my Nextcloud hardware so I created a full backup, installed NCPi on a second machine and tried to “restore” the full backup on that machine.
But seems stuck.
This is the output of log:

name@machine:~$ sudo cat /var/log/ncp.log
[ nc-restore ] (Saturday 11 March 2023, 23:23:16 +0200)
check free space...

[ nc-previews-auto ]

The backup has about 1TB, but it’s been well over 10 hours and nothing has happened…
Not sure if I should just reboot the machine and try again. But even so, what guarantee do I have that it won’t do the exact same thing?

Any help would be appreciated.
Thanks!

You do not provide any details on your hardware, nor nc and ncp versions in use, so to make any comment is like shooting in a pitch dark room blindfolded :wink:
Running ‘sudo ncp-report’ will gather all the info one needs.
I use pastebin to share (too) long output, but a text file will do fine also.

Restore of 1TB will take some time depending on your hardware.

Please read

It mentions an example, where restore of 400GB took 24h.

Just an idea: To monitor, if the restore is still active, you could for example open a parallel SSH session and take a look at top or htop to see, which processes are working / taking the CPU.

Hi all!
Thanks for your replies!
I ended up just reboot the machine and trying again (after adding some extra logs in the nc-restore script).
And now (the second time) it seems to actually be doing something.
Unfortunately the second time it failed due to insufficient space :sweat_smile:
But at least now I know what the problem is.
Will keep you posted! :wink:

1 Like

Ok, after 6 days and many trials and errors (that are simply too many to list), I finally got it working.
Some observations that are worth mentioning, though (for others who may wish to perform a backup+restore):

  1. If you start nc-restore from the terminal via SSH, you will need to keep the terminal/session open throughout the entire process! I didn’t know that and I suspect that was the reason it “got stuck” in the first place (which caused me to open this post)
  2. To check if the restoration process is actually still in progress, SSH into your server and use the top command and check if you see the pigz process. (Thanks @schoetju for this!)
  3. It’s better to just use the web interface to start the restoration process. That way you can just let it do its thing over night without having to keep the web console open (unlike an SSH terminal).
  4. Make sure the path to your “new” datadir is the same as the one you used during backup. Unfortunately, nc-restore doesn’t offer the possibility to specify a new datadir path upon restoration. Its just going to assume you want it in the same place.

Hope this helps someone in the future! (maybe even me :smile:)

One more thing worth mentioning: It would be nice if nc-restore had some kind of --verbose option. That way, even though it “spams” the logs, at least you know something is going on, regardless of how long it takes.

1 Like

For such long applications, a window manager such as screen should be used. It continues to run even if the network connection is interrupted.

2 Likes

As an alternative to screen you could also use tmux, which works similar but maybe is a bit more user friendly…

$ tmux
$ ./run-some-long-running-script.sh

SSH connection drops for some reason :frowning:

Log back in to your server

$ tmux ls
0: 1 windows (created Sat Dec 31 10:47:18 2022)
$ tmux attach -t 0

And you’re back in the perviously created tmux session :slight_smile:

1 Like