Restore a backup using the Command Line Utility
To restore a backup via the command line utility, you must use the command RESTORE. The general /O option is not used for this action, as the name of the environment is already present in the name of the backup.
Note:
For a client/server installation, you can only perform this action on the server. For a stand-alone installation, you can do this on the PC with the Profit installation. The zip file is read from the backup location.
After successfully restoring a backup (using RESTORE), the system determines if the environment in question should be converted. If required, the environment will be converted.
You can use the RESTORE command in various ways in combination with the options. See the examples below.
- Restore an existing environment from a backup.
Example: 1. Restore an existing environment from the backup.
You want to restore an existing environment from the backup.
Environment: OmgA
File: MyCompany_01-09-2015_10-00-00_1.ZIP
Backup user: MAN
Log: \logs\logfile.log.
The environment already exists and should be overwritten.
Command line:
"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /G"MAN" /L"c:\logs\logfile.log" RESTORE /B"MyCompany_01-09-2015_10-00-00_1.ZIP" /O
- Restore a new environment from a backup.
Example: 2. Restore a new environment from the backup.
Environment: OmgA
File: OmgA_01-09-2015_10-00-00_1.ZIP
Restore to: server MijnServer (SA)
Backup user: MAN
Log: c:\logs\mijnlog.log.
The new name for the environment is OmgB, which does not yet exist. The name of the environment is used as database name.
Command line:
"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /G"MAN" /L"c:\logs\logfile.log" RESTORE /B"MyCompany_01-09-2015_10-00-00_1.ZIP" /E"OmgB" /S"MijnServer (SA)"
- Restore an entire server backup folder, replace existing environments and add new ones.
Example: 3. Restore an entire server backup folder, replace existing environments and add new ones.
Backup user: MAN
The new environments are restored under their original names and on Profit SQL server 'MyServer (SA)'.
Command line:
"C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /G"MAN" /L"c:\logs\logfile.log" RESTORE /F /S"MyServer (SA)"
The first two options match the options for manually restoring a backup.
Data
Data |
|
---|---|
Action: |
RESTORE |
General options: |
The general "O" option (environment) is not used and does not have to be entered. If applicable, you can also specify the "L" option (Log). User: The general "G" (Profit User) and "W" (Profit Password) options must correspond with a user with the setting Backup copies from command line. |
Extra options for the action: |
See Options. |
Example: |
See examples |
Options for Restore
For the RESTORE command line action for restoring a backup, you have the following options:
Option |
Explanation |
---|---|
/B<Backup name> |
The name of the saved environment that should be restored. This is a zip file containing the backup of the environment in question. The file name must not include a path. |
/F |
Restore all the server backup files found. You must set the file location of backups in Profit in advance. |
/O |
This option states that the existing environment should be overwritten. If you use /F, this option is ignored and the system automatically determines if the environment should be overwritten or created. |
/E |
The name of the new environment. If the option is not included, the original name of the environment is used. If you include /F or /O, this option is ignored. |
/S<Profit SQL Server name> |
The name of the Profit SQL Server on which the backup should be restored. You can find the correct name via:
If you include /O, this option is ignored. If you include /F and the environment already exists, this option is also ignored. |
/D<Database name> |
The name of the database in which the environment should be saved. If you include /F or /O, this option is ignored. |
/C |
If required, run conversion after successful restore. |
/X |
You can include the backup date, participant name and participant number in the description when restoring by adding the X command. This looks as follows: "C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /G"MAN" /L"c:\logs\logfile.log" RESTORE /B"MyCompany_01-09-2015-00-00_1.ZIP" /O /X |
/Z |
Shrink environment (shrinkdb) after restore. Shrinking means that all the log files are deleted and an SQL server shrink is performed. This looks as follows: "C:\Program files (x86)\Profit\AFAS Windows\Kernel\Bin\AFASCMD.EXE" /G"MAN" /L"c:\logs\logfile.log" RESTORE /B"MyCompany_01-09-2015_10-00-00_1.ZIP" /O /Z |
/H |
The current user is created as a user in the environment to be restored with rights to the authorisation tool. For more information, see Central Login Environment. |
/A |
Restore the environment description of the original environment (taken from the zip file data). |
/U<description> |
Here you can enter an environment description yourself. |
/G |
The users present in the environment to be restored whose user names do not appear in the CLE are automatically added to the CLE. If you do not use this option, it will only be possible to add the users to the CLE afterwards when reconfiguring the CLE by recollecting the environment information. See Central Login Environment. |
See also