Difference between revisions of "Backup and restore"

From IPLOG
Jump to: navigation, search
Line 1: Line 1:
How to backup and restore your system. In this document, we will focus on the system backup and restore it back, including the user applications.  
+
How to backup and restore your system. In this document, we will focus on the system backup and restoration of the system, including user applications.  
  
 
== Backup user data ==
 
== Backup user data ==
All user data and changes are stored in '''/mnt/userfs'''. This partition can be backed up by running the command:
+
All user data and changes are stored in '''/mnt/userfs'''. This partition can be backed up by the following the command:
  
 
{{NotePre
 
{{NotePre
Line 18: Line 18:
 
}}
 
}}
  
Note: The /tmp/ folder is temporary. After reboot, the content is empty. If you want to keep the backup, move the files to a permanent storage.
+
Note: The /tmp/ folder is temporary. After reboot, the content is empty. If you want to keep a backup, move the files to a permanent storage.
  
  
 
== Restore user data ==
 
== Restore user data ==
Data to restore must be placed in '''root temporary directory(/tmp)'''. Copy the backup files to that location.
+
Data to restore must be placed in the '''root temporary directory(/tmp)'''. Copy the backup files to that location.
  
 
{{NotePre
 
{{NotePre
Line 29: Line 29:
 
}}
 
}}
  
Then it is possible to start a data restoration command:
+
Then it is possible to start the data restoration command:
 
{{NotePre
 
{{NotePre
 
|text=root@buildroot:~#metel-restore
 
|text=root@buildroot:~#metel-restore
Line 53: Line 53:
  
 
Select '''Yes''' if you want to go back to a given state of the system.<br/>
 
Select '''Yes''' if you want to go back to a given state of the system.<br/>
Select '''No''' if you want to merge the current user data with the data from the backup. If there is a conflict between files, the backup file is applied.<br/>
+
Select '''No''' if you want to merge the current user data with the data from the backup files. If there is a conflict between files, the backup file will be applied.<br/>
 
It is strongly recommended to do a reboot.
 
It is strongly recommended to do a reboot.
  
Line 62: Line 62:
  
 
== Restore customer application ==
 
== Restore customer application ==
The user application is running on the device immediately when you begin. If you perform an unwanted change and the need to return to the state after purchase, use this option.
+
The user application is running on the device immediately when you begin. If you perform an unwanted change and need to return to the state after purchase, use this option.
  
  
Line 69: Line 69:
 
   
 
   
  
In '''/home/''' there are two files with backup of the customer application:
+
In '''/home/''' there are two files with backup of customer application:
  
 
{{NotePre
 
{{NotePre

Revision as of 05:15, 4 May 2018

How to backup and restore your system. In this document, we will focus on the system backup and restoration of the system, including user applications.

Backup user data

All user data and changes are stored in /mnt/userfs. This partition can be backed up by the following the command:

root@buildroot:~# metel-backup
This will create 2 files.
/tmp/backup.tar 
* it contains an image of /mnt/userfs partition

/tmp/permissions
* it contains file access rights and ownership

Note: The /tmp/ folder is temporary. After reboot, the content is empty. If you want to keep a backup, move the files to a permanent storage.


Restore user data

Data to restore must be placed in the root temporary directory(/tmp). Copy the backup files to that location.

/tmp/backup.tar
/tmp/permissions

Then it is possible to start the data restoration command:

root@buildroot:~#metel-restore

Before restoring, you will be asked if you want to delete the current user data first.

root@buildroot:~# ls /tmp
-rw-r--r-- 1     root root     8824832 Jan 5 15:40 backup.tar
drwxr-xr-x 3     root root     60 Jan 5 12:19 cron
-rw-r--r-- 1     root root     0 Jan 5 12:19 dnsmasq.leases
-rw-r--r-- 1     root root     88731 Jan 5 17:03 messages
-rw-r--r-- 1     root root     5129 Jan 5 15:40 permissions
-rw-r--r-- 1     root root     55 Jan 5 17:15 resolv.conf
-rw-r--r-- 1     root root     27000832 Jan 5 10:06 rootfs.ubi
drwxr-xr-x 5     root root     100 Jan 5 12:19 SMS
-rw-r----- 1     root root     440 Jan 5 12:20 smsd.log
-rw------- 1     root root     0 Jan 5 12:19 sshd
-rw-r--r-- 1     root root    4060544 Dec 20 09:32 zImage

Do you want to delete all user data before recovering from backup? [y/N]:

Select Yes if you want to go back to a given state of the system.
Select No if you want to merge the current user data with the data from the backup files. If there is a conflict between files, the backup file will be applied.
It is strongly recommended to do a reboot.

root@buildroot:~# reboot


Restore customer application

The user application is running on the device immediately when you begin. If you perform an unwanted change and need to return to the state after purchase, use this option.


Contact: support@metel.eu


In /home/ there are two files with backup of customer application:

/home/backup_customer_app.tar
/home/permissions_customer_app

Copy and rename these files:

root@buildroot:~# cp /home/backup_customer_app.tar /tmp/backup.tar
root@buildroot:~# cp /home/permissions_customer_app/tmp/ permissions

Then run:

root@buildroot:~# metel-restore
Do you want to delete all user data before recovering from backup? [y/N]: y

It is strongly recommended to do a reboot.

root@buildroot:~# reboot