Skip to main content

Restore a company file from a backup

A restore returns the company file's database to its state when the backup was taken. You use the same wizard in which you take the backup, whether or not a company file is open.

Before you begin​

  • You need the Restore from Hard Disk permission in the Users window. With no file open the program checks no permission, but it asks for the system administrator's name and password if one is defined.
  • Ask every user to leave the file. The restore does not run while another user has the file open.
  • Decide which backup you want, and read its notes and date. If you are not sure, take a fresh backup first. The wizard suggests this itself.
  • With a file open, save your work. The restore closes all open windows.

What the restore replaces​

  • The whole database: SQL Server replaces the database contents with the backup contents. Everything entered after the backup date, such as entries, invoices, cards and changes, is lost.
  • Users, passwords and permissions return to their state at the backup time, because they are stored inside the database. Sign in with the old password.
  • The log file is replaced as well, because it is inside the database. This is why the wizard offers to export it before the restore.
  • Not affected: other files on the server, and the backups that already exist.

Steps​

The steps are split by your situation: a company file is open, or no file is open.

Restore an open file​

  1. Click File, then Home, then the Backup button.

  2. Click the Restore Backup from Hard Disk tile. If windows are open, the program asks: "All opened windows must be closed before performing this operation. Are you sure you want to do this?". Click Yes to close them. If you click No, you stay on the first page of the wizard.

  3. The next page lists the stored backups of the database, newest first. Select the row you want. Its notes appear in the box below the list, which is read only.

    List columns:

    ColumnMeaning
    Lock column (no title)Shows no value and does not protect the copy in this version. To keep a copy, copy its file to another folder.
    DateDate and time the backup started.
    SizeSize of the backup.
    FileFull path of the file on the server computer.

    Buttons above the list:

    • Browse: opens a file chooser for *.dat and *.bak files. The program replaces the list with one row, the file you chose. SQL Server reads the file on the server computer, so choose a file the server sees under the same path.
    • Stored Backups: reloads the list of backups the server knows for this database. Use it after Browse to go back to the list.
    • Delete: deletes the selected row. For a stored backup the program asks "Are you sure you want to delete?", and if you confirm it deletes the file from the server's disk and its history. For a file chosen with Browse it only removes it from the list.
  4. To keep the log file, tick Export Log File before Restoring the Copy. The program fills the box with the path AmeenLogfile.txt in the log folder. To change it, click the button in the box and choose a *.txt file.

  5. Click Next. The button stays disabled until you select a copy.

  6. If the file is the central file that collects loyalty card points, or is linked to one, a warning page appears: "This file is a centralized database to accumulate loyalty cards points ..." or "The file is linked to a centralized database to accumulate loyalty cards points ...", then "Are you sure you want to continue?". Select Yes, then click Next. If you select No, Next stays disabled and the restore stops. This page does not appear in other cases.

  7. The next page asks: "Do you want to make backup copy on the hard disk before restore to avoid losing any information?". The Yes option is preselected, with a Notes box holding default notes below it. Leave Yes selected unless you have a fresh backup. Select No to skip this backup, then click Next.

  8. A warning page shows one of two texts. If the last backup the program took is more recent than the number of minutes set in Warning when restoring after (15 by default): "Last backup date ... at ..." followed by "Retrieving the backup will delete all operations, and you would not be able to retrieve data except for last version data!! Are you sure you want to retrieve the backup?". Otherwise: "The backup retrieving will delete all operations. Are you sure you want to retrieve a backup?". Select Yes, then click Next to continue. If the warning value is 0, the page does not appear.

  9. The last page says: "The restore Wizard is ready now to restore backups, click "Start" to start the operation or click "Back" to change the options.". Click Start.

  10. Wait. The program shows what it is doing, in order: "Exporting log file", then "Creating backup", then "Restoring backup". The program cuts its own connection to the database, restores it, and reconnects. Do not close the window or the program.

  11. The message "Operation completed successfully" appears. If your licence includes the notification system, a message also tells you to run the "Rebuild the Schedule" maintenance after a restore, so that time-scheduled messages work correctly. Then the message "File will be closed after being restored. If you want to log in the file again, you should open it" appears.

  12. The program closes the file and shows the sign-in window for it. Sign in with a user name and password that existed at the backup time. See Sign in to a company file.

Restore with no file open​

Use this to restore a database that no longer opens, or to create a new file from a backup. The Backup button on Home works with no file open only in the standard edition.

  1. Start the program without opening a file. Click File, then Home, then Backup.

  2. Click the Restore Backup from Hard Disk tile.

  3. If the SQL server has a system administrator, the System administrator page appears: "Please enter system administrator name and password". Enter the System administrator name and the Password, then click Next. A wrong entry gives "No such user or group" or "Invalid password". If there is no system administrator, this page is skipped.

  4. On the next page, the Server appears at the top. Click its name to choose another server. The server you choose becomes the default server on this computer. The name turns red if the server cannot be reached, and a message explains why. Then choose the restore target:

    • Existing Database (preselected): choose from the list, which has the columns Name and Description and a search box. The restore replaces this database with the backup.
    • New Database: the program creates an empty database and restores into it, so your current databases stay as they are. The Files Location box holds a new file name in the data folder. Click the button in the box to choose another name with the *.sdf extension. Choose this to get a copy of the file for testing or inspection.

    Next stays disabled until you choose a database, or until the new file has a location.

  5. For an existing database, a credentials page appears: "Please enter the username and password of a user who has the authority to restore a backup copy from the hard disk". Enter the User name and Password of a user of that database. The program checks them, and an error gives "Incorrect user name" or "Incorrect password".

  6. On the backup page, choose the file with Browse. For an existing database the Stored Backups button also appears, so you can pick from the database's own backups. Click Next.

  7. For an existing database the warning page appears: "The backup retrieving will delete all operations of invoices and entries that has been done since that version was installed till now. Do you want to retrieve the backup?". Select Yes, then click Next. For a new database this page does not appear.

  8. Click Start. For a new database the program first shows "Creating new database", then "Restoring backup".

  9. The message "Operation completed successfully" appears. The database is added to the recent files list, and its sign-in window opens. If an error occurs, its message appears and the wizard closes. With a new database, the empty database stays on the server.

Result​

The database returns to the backup's state: entries, invoices, materials and users as they were on that day. What you entered afterwards is gone, so enter it again. If the backup came from an older program version, signing in may ask you to update the file first.

If you asked for a backup before the restore, you have a copy of the file as it was before. It is in the Stored Backups list, and you can go back to it the same way.

If something goes wrong​

MessageWhy it appearsWhat to do
Database is Opened By Users, with a list of their names and computersOther users are connected to the file.Ask them to leave, then retry.
The files are in exclusive mode, you can't log on to the files now.Another computer is working on the file in exclusive mode.Wait until it finishes, or make it leave the file.
The path is incorrect by server, please check the path: followed by the file nameSQL Server cannot read the backup file at that path.Put the file in a folder the server sees, or choose it from Stored Backups.
An error about a file, a path or an incompatible SQL Server versionThe backup comes from a newer SQL Server than yours, or the file is damaged.Read the message text. Restore on a server of the same or a newer version.
The list is empty (no message)The server has no backup history for this database, for example a new or moved database, or the history holds a copy larger than 2 GB.Use Browse and choose the file.
The text stays at "Exporting log file" or "Creating backup" with no messageThe export or the backup failed, for example the log path is empty or the backup folder is not valid. The restore did not start.Close the window, check the paths and retry.
No such user or group, Invalid password, Incorrect user name, or Incorrect passwordThe sign-in details on the System administrator page or the database page are wrong.Enter a user who exists in the database now, or the system administrator defined on the server.

This page applies to alameen ERP 10, version 10.1.79.764.