Restore from command line specific file in folder

Hi,

We would need today to restore all files in a specific folder based on a point in time…

for example:

Need to restore all files in /data/folder1/ as May 6, 2020

Clipping from the user’s manual: 9.2 Restoring file backups:

When performing file backups UrBackup creates a file system snapshot identical to the client’s file system at that point in time. As such, you can simply make those file system snapshots available to the clients via any file sharing protocol or application, such as Windows file sharing (or samba), FTP/SFTP, WebDAV…

So the most universal restore method is download that files from the backup folder by SFTP or Samba:
Backup path example:
/media/BACKUP/urbackup/DatDebian10Test1/200507-1755/rootfs

thanks @Dmitrius7

But from the command line, is it possible ?

What operating system do you use for:

  • UrBackup server?

  • Client?

  • Computer to that you want to restore folder?

Does the client have GUI interface or only command line?

Server: 2.4.12
client: 2.4.9.0
No GUI, just command line.

I don’t use urbackup commands for restore backups from comand line. Instead it I use SSHFS (it’s more simple).

Example:
Server IP: 192.168.5.10
Client IP: 192.168.5.15

Steps:

  • Create at the client folder sudo mkdir /urb-restored;

  • Connect via SSH to server;

  • Mount that client’s folder at UrBackup server sudo sshfs root@192.168.5.15:/urb-restored /mnt -p 22;

  • df -h you will see that remote folder mounted;

  • now you can copy files via mc from backup folder to /urb-restored;

  • after finished umount /mnt;

  • Now at the client move restored files from /urb-restored to folders what you want.

1 Like

Ahhhh that’s ok for us. I was more thinking about a urbackupctl command for a oneshot deal! :wink:

I didn’t find any information in the administration manual about urbackupctl command. Therefore I use sshfs for recovery.

If you will know how to use it text me.

1 Like

I´ve got the same situation: have backups, my client went down (it is an ubuntu server) and I need to restore files from bakcup server (another ubuntu server). No clear restoring info in manual, the client command line options have poor information.

Thnx for clarifying other way to work around, Dimitrius7, now I am thinking about other backup tools than urbackup.

A few ways to restore:

  1. web ui , server side, urbackup protocol

To restore, the new client must have the same name than the old one.

The default is client-confirm, it works If you have a gui (windows only), you start a restore from the server web interface , a pop up appear on the client to confirm restore.

If you don’t have a gui you can use server-confirm (client side config), which will make the confirm pop up appear on the gui. It’s my favorite way t do restores.

Then from the server go to : backup select client , then date then folder and click restore.

  1. web ui , client side , urbackup protocol
    on window client, from the systray, restore, browse the backup date and file , click restore.

  2. web ui, zip file
    go to : backup select client , then date then download zip file.
    Lot of peoples use this way

  3. commandline
    urbackupclientctl
    You gotta look at the doc, it works, it’s annoying to use
    You gotta identify the backup id via the web interface, it’s not tui, it s using parameters

  4. scp , because yes urbackup store files as file
    Please don’t do that, surely don’t do it to restore folders.
    Maybe it works “a bit” if you use btrfs to store the backups, but else it’s a very bad idea.

Hello orogor, tnx for response.

I use Ubuntu servers with no gui, just command line. The gui from Urbackup server is accessed from another windows computer to manage and admin the backup jobs. Your instructions are clear, but just instruction 4 will work for me as far as I know. But in fact it is true: urbackupclientctl command line is annoying because is not very well documented, it was not build (in my opinion) thinking in situations that servers won´t use GUI…

I will try to rescue via command line but I am really afraid to do a mess or something worse. I have no space for errors.

Best Regards,

Johnson

Why only this way would work? You want to restore to a different client with a different hostname?

I think you can also override the client name in the config of the agent.

That should allow both to match without touching the actual hostname of the server.
Then set server-confirm , and restore from the web ui on the server.

I´ve got stucked on client confirmation, because my client doesn´t have graphical interface.

In /etc/default/urbackupclient , set : RESTORE=server-confirms , then restart the client service

Yes, in your screenshot, it’s a bit odd, because the online status in the forced discovery panel isn’t the same than in the main status panel.

My guess is that the restore would still work, try to also restart the service on the server and wait 5 minutes. Then go to the backup tab, and see if the restore option appear in addition to the download zip option.

1 Like

Now the server says the client is offline, after changing RESTORE=server-confirms! :tired_face: :tired_face: . Tried to reinstall the client, restart services, pray, and is still saying is offline…

Just want connect, restore the files and get rid of this software…

Worst case, you can always go on the backup server and grab all the files you need from the “data” folder you have.

yes this is the way I am thinking to do.

Tnx to all for helping, but for me this is the endline with Urbackup

Don’t think you need to get rid of urBackup, maybe you should just “play” a little bit more with a “test” machine on windows and Linux to understand how it works and in some case, to script some stuff!

1 Like

PointPubMedia, I have one question: how do U deal with full and incremental restores? example: I have one full backup. I grabbed all the files from the data folder. but I have 10 incremental backups made after the full backup. Shoud I do the same grabbing process with each incremental data folder?

We never had to deal with a full restore 'cause of a machine crash! But yeah, it will be like that. Restoring the last full, then each incremental!

That’s why you need to think about, when doing a full backup.

I like the idea of a full each sunday and incremental each days after… depend also how you protect your machine/vm/container.

On our Windows server we use Shadow copy service that run 2x per day so we can restore files easily in case of a mistake and we use urBackup for the full in case of a “full crash” of the machine.

As we are having only “VMs”, having a machine crash it’s not happening. Most of the time, we need to restore a point in time of a bunch of files 'cause the user deleted some files by mistake!