Copying your SAP Business One production database has many useful applications, but nonetheless some users may not know how to take advantage of the feature, or others may think it’s more complicated than it really is. Today we’ll look at how you can restore your production database in a test database, so that you can work with up-to-date information as you test the system. By backing up a database you can try out newly written queries or reports before moving them back to their production database.
Even if you aren’t a user with authorizations to copy your database, by the end of the article, you’ll see that it is a very standard operation. With this as a guide, you’ll be able to better manage expectations in your company about how long such a task should take to be accomplished.
A Note About Database Versions
Before getting started, the process may be a little different depending on which version of Microsoft SQL server you’re using but should be familiar. Also, it’s worth noting that this isn’t the only way to do it. There are other ways, such as using the remote support desktop and the system landscape directory to perform a backup and restore. However, we’ll be looking at this traditional method that we’ve used for SAP Business One databases running on the standard Microsoft SQL server version.
Backing Up Your Database in SAP Business One
To begin, open Microsoft SQL server. Note that your will need to be a system administrator in Microsoft SQL to do this. Once opened, you’ll see the ‘Databases’ folder, expand it to reveal your databases. It’s here where you might find test databases that you have in your company. To back up a database, highlight it with your cursor, right click, then go to ‘Tasks’ and select ‘Back up.’ This will prompt a new window that contains information about the selected database including the source database, recovery model, backup type, backup component, and then the destination where you want the backup to go. In most server environments this will be to a disk.
Users will be presented with the default path, but you’re free to add a new location, just be sure to name the file with the extension “.bak”. This is important because the restore routine will look for this extension in order to make it work. Then click ‘OK’. From here the path will be used as the destination for your backup. You can measure the progress of your backup by looking at the progress window in the bottom left-hand corner of the screen. When completed, users will be presented with a notification from Microsoft SQL Server that the backup of the database has been completed successfully.
Locating Your Database Backup
Select the ‘File Explorer’ from your desktop computer, from here go to your relevant drive, then program files folder, then Microsoft SQL Server. Next locate the version folder that you’re working with and go to ‘Backup’ folder. This is typically where the backup or BAK file you created will be located.
Restoring Your Database
When you are ready to restore your database, return to the Microsoft SQL Server Management Studio, right click on the ‘Database’ folder, and click on ‘Restore Database.’ You will be presented with new dialog boxes, where you will specify the ‘Source’ and ‘Destination’. By selecting the ‘Device’ radio button, you can locate the backup file. Users will now be presented with a ‘Select backup devices’ screen. From here ensure the backup media type displays ‘File’ and add one to it. By default, it will open the backup folder located on the drive that contains your program file. Clicking ‘OK’ on your backup file will then add the pathway to the previous window, ‘Select backup devices.’ Then click ‘OK’ once more.
A Very Important Step
Users should take note when restoring their database that the database name in the destination needs to be a new name, otherwise you may overwrite your production database. So, ensure the destination database file name is something different. Clicking ‘OK’ will begin the process, and you can again view the progress in the window in the lower left-hand side of the screen. Once its completed, you will be presented with notification that the database has been restored successfully.
Accessing the Database in SAP Business One
To access the database that you created go to ‘Modules’, ‘Administration’, and ‘Choose Company’. If the database isn’t on the list yet, click the ‘Refresh’ button and you should be able to access your database. Once completed, you’ll have access to up-to-date data to work with in a test environment. This is particularly useful as a company grows from the initial installation of SAP Business One and the test environment no loner reflects how they make use of SAP Business One. If, for example, you are trying to train yourself to use an invoice, it’s of course beneficial to have that invoice in the test environment which is why you might want to have a more up to date database to work with.
To learn more about how to backup and restore databases in SAP Business One for the purposes of practicing or testing out features without affecting your production database, watch the Vision33 TOTAL Care Wednesday web chat demo. In the video, host and SAP Business One Ambassador Carl Lewis will walk you through the process step by step.