We want to move off one server (MySQL) to another (MSSQL), and have several years worth of historical data. I have a DB setup on the new server, and tested it with a couple of testing tags, seems like that's working well so far.
Is it as simple as exporting from one server into the other?
Is the tag ID only used in the partition tables and the te table?
I just realized there are three schemas in MySQL with separate historians, which means that for each one, the tag ID starts at one, so I would need to remap them if I bring them all into one DB on the new server, OR I could create two more separate Historian DB's on the new server and not worry about tag ID collisions. Thoughts on that?
Also, it looks like there could be an issue with the partition names, creating possible duplicates (assuming I combine them all into one DB). And I have a question on the naming convention for the partitions: What does the number after sqlt_data_ mean? I see most of the tables have a 1, and a few in the new historical DB have a 3.
It turns out, the process is not as complicated or as worrisome as I thought. The structure of the Historical tables is easy to understand, given that one has a general understanding of relational databases and database systems as a whole. The process, so far, has been fairly seamless, no downtime, and maybe a couple of missed tag scans, (most of the tags moved over as of now scan once every hour). And it went like this:
create the new historian DB
ensure a proper user has proper permissions
(At this point, I created a test tag which caused the Historian to create the tables for me.)
Create the table structure
Export the data from the current historical tables
(I moved a couple of non-mission critical tags over to get a feel for what might happen, if anything.)
Import the "main" table data first
Import the historical data next - this was imported into new tables, then I ran INSERTS to move that data into the new historical tables.
While I was importing the historical data, I moved over one folder's worth of tags, non-mission critical. I was able to read the history from the date ranges available from the import.
This is where I am at now. The next steps should work without any problems, I hope.
Move the rest of the tags over.
Export the remaining historical data collected since I began this migration
Import into new DB.
Check for any missed tags, connections, missing history...
Drop the old historical DB.
I found that using Microsoft's Migration Assistant for MySQL, works well for converting the MySQL schemas/tables, creating those objects, and facilitating the export/import process.
If anything outside of the expected happens during the last few steps, I'll post an update here.
EDIT: This is a slow process, as I estimate 600 to 700 million records are being imported into SQL Server, but it is faster than if I had to do this without the SSMA.