Difference between revisions of "Backup and restore"

From IPLOG
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
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.  
+
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 the following the command:
+
All user data and changes are stored in '''/mnt/userfs'''. This partition can be backed up by using 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 a backup, move the files to a permanent storage or to different place than /tmp/.
+
Note: The /tmp/ folder is a temporary. After reboot, the content will be empty. If you require a backup, move the files to a permanent storage or some other destination than /tmp/.
  
  
== Restore user data ==
+
== Restore User Data ==
Data to restore must be placed in the '''root temporary directory(/tmp)'''. Copy the backup files to that location.
+
Data to restore must be placed in the '''root temporary directory(/tmp)'''. It is important to copy the backup files to that location.
  
 
{{NotePre
 
{{NotePre
Line 29: Line 29:
 
}}
 
}}
  
Then it is possible to start the data restoration command:
+
Now it is possible to start the data restoration command:
 
{{NotePre
 
{{NotePre
 
|text=root@buildroot:~#metel-restore
 
|text=root@buildroot:~#metel-restore
Line 52: Line 52:
 
}}
 
}}
  
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 files. If there is a conflict between files, the backup file will be 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 61: Line 61:
  
  
== Restore customer application ==
+
== Restore User Data to Factory ==
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.
+
The user application begins to run on the device immediately once 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/backup''' there are two files with backup of customer application:
+
In '''/home/backup''' there are two files with backup of customer applications :
  
 
{{NotePre
 
{{NotePre

Latest revision as of 12:03, 15 February 2019

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 using 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 a temporary. After reboot, the content will be empty. If you require a backup, move the files to a permanent storage or some other destination than /tmp/.


Restore User Data

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

/tmp/backup.tar
/tmp/permissions

Now 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 User Data to Factory

The user application begins to run on the device immediately once 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/backup there are two files with backup of customer applications :

/home/backup/backup.tar
/home/backup/permissions

Copy these files to tmp/:

root@buildroot:~# cp /home/backup/backup.tar /tmp/backup.tar
root@buildroot:~# cp /home/backup/permissions /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