Overview
Note: This article regarding SQL servers applies to Stone Edge 7.730 or newer versions. Older versions may not work when archiving SQL Servers.
- Once your store has been up and running for some time, you may notice the following:
- You have a lot of old order data that you no longer need.
- It has been running slower recently.
- The database file size is substantially larger.
- These are good reasons to look into the archiving functionality Stone Edge provides.
- The process works for both Access and SQL Databases.
- Archiving will remove old orders and customers from your database to another file.
- For Access databases -> the backup will be another Access database.
- For SQL databases -> the backup will be saved as a separate database attached to the server.
- The archived data will be held:
- Access database -> The same folder as your database
- SQL database -> where SQL data is stored (set by a system parameter)
- When performing the archive, make sure everyone is out of Stone Edge.
- It would be best if you used the archiving tool built into Stone Edge because of how the tables are set up.
- For SQL databases, you CAN NOT go into SSMS and use the archiving tool there.
Backup your Database
- Before performing the archive process, many people choose to create a backup of their entire database in case of an error during the process.
- This will be done automatically for an SQL database as part of the archive process.
- Click HERE to find out how to perform a backup.
Setting Parameters (SQL Database)
- If you are archiving an SQL database, a few parameters must be set before archiving is possible.
- Main Menu -> Gear Icon (Settings)
- System Functions -> Set System Parameters
- Parameter Group = Program
- Parameter = SQLServerPathData
- Click the folder icon to open up a file explorer window.
- The path must be where the SQL database is saved.
- In this case, it is C:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\DATA
- Click “Save”
- Parameter = SQLServerPathBackup
- Click the folder icon to open up a file explorer window.
- The path must be where the SQL stores backups.
- In this case, it is C:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\Backup
- Click “Save.”
Archiving an Access Database
- Main Menu -> Gear Icon (Settings).
- Data Functions -> Archive Old Data.
- A pop-up that reviews what will happen when you archive the data will appear.
- Click “OK”
- Select an archive name.
- Default name: Database Name + Archive + Date
- Click “OK.”
- A calendar will appear -> Select a date.
- All ORDERS from before the date will be archived.
- Use the dropdown at the top to change the year.
- Click the day desired.
- Click “OK”
- A calendar will appear ->. Select a date
- All CUSTOMERS from before the date will be archived.
- Use the dropdown at the top to change the year.
- Click the day desired.
- Click “OK”
- A Confirmation pop-up with your choices will appear.
NOTE: The screenshot shows the date to be 01/01/2022 for both dates. - Click “OK”
- The archiving process will start.
- A progress bar will be on the bottom right of the Access screen.
- Depending on the database size, the program may show (Not Responding) DO NOT click around on the program, or you can cause an error.
- If you are worried there is no progress, open Task Manager to see if the CPU and Memory that Access is using are changing; that shows the program is still running.
- A pop-up will appear with an overview.
- Click “OK”
- The archive will be where your active database is located.
Archiving a SQL Database
- Main Menu -> Gear Icon (Settings)
- Data Functions -> Archive Old Data.
- A pop-up that reviews what will happen when you archive the data will appear.
- Click “OK”
- A calendar will appear ->. Select a date
- All ORDERS AND CUSTOMERS from before the date will be archived.
- Use the dropdown at the top to change the year.
- Click the day desired.
- Click “OK”
- Archiving process will start.
- A message on the bottom-left of the Access screen will display what is currently happening.
- Depending on the database size, the program may show (Not Responding) DO NOT click around on the program, or you can cause an error.
- If you are worried that there is no progress, open Task Manager to see if the CPU and Memory Access is using changed values, showing the program is still running.
- A pop-up will appear when the archive is complete.
- Click “OK”
- The following will have occurred:
- The database will still be connected to your server, with the archived data removed.
- The archived data will appear in your database list, which can be exported as a .bak file.
- Database name default: Database Name + Archived + Date (yyyymmdd)
- A backup file of the original database will be created.
- File name default: Database Name + Backup + Date (yyyymmdd) + [h]mmss
- The file path will be where SQLServerPathBackup is set to (can be moved afterward).
Accessing Archived Data
Access Archive
- Open the archived file using the “Switch Stores” button in Stone Edge.
- Click the folder icon to open file explorer and locate the database.
SQL Archive
- The archived data should already be listed as an active database in SSMS
- restore the .bak file in SSMS.
- Create an ODBC connection to the restored database.
- Use the “Switch Stores” button in Stone Edge and go to “System DSNs” to find the ODBC connection.
- The following message will appear when accessing the archived data.
Troubleshooting
- Error 3146 ODBC Call Failed
- For SQL databases, when the paths are not set correctly.
- Redo the system parameters and try again.
- Timeout Error
- Find the system parameter SQLServerPathODBCTimeout.
- Set parameter value = 0 and save.