Explainer
What the Historian Runtime migration script's SQL users mean
Short answer
The script reconnects the six restored Runtime database users (wwAdmin, wwUser, wwPower, aaAdmin, aaUser, aaPower) to destination server logins and assigns database ownership to the aadbo login. aadbo is a named login the procedure expects, not your current username: run the line as written, create any missing logins through the release's configuration procedure, and verify with the account the Historian service uses.
On this page
- What does the Runtime migration script actually change?
- Is aadbo the username I am currently logged in with?
- Why do restored database users come back orphaned?
- What is the difference between a login and a database user?
- What do the wwAdmin and aaAdmin account names mean?
- What does each statement in the script change?
- What should I check before running the script?
- The database opens but acquisition still fails — is it the SQL users?
- Questions asked
When you restore an older Runtime database onto a new Historian 2017, 2020 or 2023 server, the database arrives carrying its own users but no working link to the destination server's logins. The migration script in the procedure fixes exactly that chain: six ALTER USER ... WITH LOGIN mappings, six ALTER LOGIN ... WITH DEFAULT_DATABASE = Runtime settings, and one ownership line, ALTER AUTHORIZATION ON DATABASE::Runtime TO aadbo;. That last name is the one that confuses people: aadbo is a specific login the procedure expects on the destination server, not a placeholder for the account you happen to be signed in with. The rest of this article walks the chain — login, user, default database, owner — so you can predict which statements will succeed on your server before you run any of them.
What does the Runtime migration script actually change? #
It changes SQL Server security only: six user-to-login mappings, six default-database settings and one ownership line — 13 statements in total, touching no tag data and no acquisition configuration.
The script runs against the restored database after the procedure has you delete the destination server's existing Runtime database and put your backup in its place. Seven named principals appear across it: the six accounts wwAdmin, wwUser, wwPower, aaAdmin, aaUser and aaPower, plus the owner login aadbo — 6 users plus 1 owner.
What it does not do matters just as much. No statement in it creates a login, enables a disabled one, changes a password, or repairs a driver or connector. If the restored database is visible in the administration tool but connections fail, the fault sits in the security chain this script addresses. If the database opens and queries return, the script was never your problem.
Is aadbo the username I am currently logged in with? #
No — aadbo is a named server login that the migration procedure expects on the destination, and the line hands ownership of Runtime to that login; run it exactly as written and do not substitute the account you are logged in with.
The statement is the script's last line and appears in the current revision of the migration instructions, which is why an older saved copy of the script omits it. Ownership is a property of the database, not of your session: the owner is the principal the database falls back to for administration, and it outlives whoever ran the script.
Commit to this decision: run the line exactly as printed. If the destination server has no aadbo login, create it through the Historian installation and security configuration for the target release, then run the line — do not retarget the statement to your administrator account. The installation expects the documented owner, and an undocumented one complicates every later restore or ownership operation on that database.
Why do restored database users come back orphaned? #
A restore brings the database's users with it but not the destination server's logins, and SQL Server matches the two by security identifier, so a login recreated under the same visible name does not reconnect automatically.
Microsoft's orphaned-user guidance describes the condition exactly: a database user whose login is no longer present in the server's master database. Users live inside the database file and travel with the restore; logins live in master and stay behind on the old server.
The link between the two scopes is the security identifier, not the name. SQL Server generates a fresh SID for every login it creates, so a login rebuilt by hand on the new server holds a different SID from the restored user even when both read the same in a listing. Same name, no mapping: the user is orphaned, and connections through it stop at the database boundary. That is the exact gap the six ALTER USER lines close.
What is the difference between a login and a database user? #
A login is a server-scope principal that authenticates a connection; a database user is a database-scope principal that carries permissions inside one database, and the mapping between them is what a restore breaks.
Put plainly: the login answers "can this connection reach the server at all," and the user answers "what may it do once Runtime is open." The Historian service and its administration tool depend on users inside Runtime for their permissions, which is why a broken mapping shows up as a database-level failure, not as a rejected sign-in.
Check both scopes in SQL Server Management Studio: the server-level logins list, and Runtime's own users list, where each user shows the login it maps to. A matching name on both sides proves nothing — the mapping is the evidence. And your administrator account connecting fine proves only that your administrator account works; it says nothing about the six migration accounts.
What do the wwAdmin and aaAdmin account names mean? #
They are two generations of the same built-in account set: wwAdmin, wwUser and wwPower are the older names, and aaAdmin, aaUser and aaPower are the names that replaced them, so the script maps both to serve sources from either era.
Historian's security has historically been managed largely through SQL Server accounts, and the ww names date from the InSQL era of that lineage. One procedure has to serve every source version, so it carries both sets: a database from the older generation holds ww users, a newer one holds aa users, and a long-lived database can hold both. Map whichever users your restored Runtime actually contains — a name present in the script but absent from your database fails and changes nothing.
The model itself is legacy: current releases rely on it far less, though it remains supported for backward compatibility. The script keeps a restored database working under the security model it was built with; converting that model is a separate project, not part of the migration.
What does each statement in the script change? #
The script uses three statement forms: ALTER USER re-points a restored user at a destination login, ALTER LOGIN sets that login's default database, and ALTER AUTHORIZATION sets the database's owner — each at a different scope.
USE Runtime
ALTER USER aaAdmin WITH LOGIN = aaAdmin
ALTER LOGIN aaAdmin WITH DEFAULT_DATABASE = Runtime
ALTER AUTHORIZATION ON DATABASE::Runtime TO aadbo;
The script repeats the first two forms for all six account names; each form is shown once here.
| Statement form | Scope it changes | What it does |
|---|---|---|
ALTER USER ... WITH LOGIN |
The database user, inside Runtime | Re-points a restored user at the destination login, repairing the orphaned mapping |
ALTER LOGIN ... WITH DEFAULT_DATABASE = Runtime |
The server login | Sets the database a connection lands in when it names none |
ALTER AUTHORIZATION ON DATABASE::Runtime TO aadbo; |
The database itself | Sets the owner principal of Runtime to the aadbo login |
Two boundaries are worth keeping straight. The default database is a convenience setting on the login, not a permission — a client that names its database explicitly ignores it, and a login with the right default still needs its user mapping to get in. And the statements are independent: one line failing neither rolls back nor blocks the rest, which is what lets you rerun only the lines that failed.
What should I check before running the script? #
Inventory both scopes and count: the users inside the restored Runtime, the logins that exist on the destination server, and whether aadbo is among them — the numbers tell you which statements will succeed before you run anything.
Take one recoverable backup of the restored Runtime database before running the script; every statement in it is a rerunnable metadata change, so that backup is your whole safety margin.
Illustrative example, not a measured result. A fresh Historian 2023 server whose installation created the current-generation logins — aaAdmin, aaUser, aaPower, 3 logins — receives a restored Runtime carrying all 6 users. The match is 6 users − 3 logins = 3 orphaned users, the ww set. The script's arithmetic: 6 ALTER USER + 6 ALTER LOGIN + 1 ALTER AUTHORIZATION = 13 statements. On this server, 3 mappings + 3 default-database lines = 6 succeed for the aa names, 3 + 3 = 6 fail for the ww names because those logins do not exist, and the ownership line succeeds if aadbo is present: 7 of 13. The repair is to create the 3 missing logins through the release's security configuration and rerun the 6 failed lines, bringing all of it into effect: 7 + 6 = 13.
Decide by what the counts show:
- All six account logins and aadbo exist: run the script as written and expect all 13 statements to apply.
- The ww logins are missing and the source is an older release: create them through the Historian configuration for the release, rerun the six failed lines, and leave the script's text alone.
- The source already used only the aa names: let the ww lines fail, confirm the aa mappings and the ownership line succeeded, and move on.
Prove the result through the mapping, not the name: after running, Runtime's user list should show each of the six users mapped to its login, and a connection test under the account the Historian service actually uses — naming Runtime explicitly — should open and return a query.
The database opens but acquisition still fails — is it the SQL users? #
No — once the database opens and queries return, SQL security has done its part, and a failed tag path is a connector, driver or source-configuration problem that the migration script never touches.
The security chain ends where the data path begins. Acquisition depends on connector configuration, protocol and driver settings, and the source system's availability, none of which any statement in the script modifies. Diagnose it from the acquisition diagnostics as a data-path fault, not as a permissions fault.
If the migrated server lists no PLC connection options at all, that is a distinct post-migration symptom with its own cause — see why a migrated historian shows no PLC connection options. During cutover you can also keep both servers collecting by following how to run two Plant SCADA Historian connectors during migration, so the new server is verified against live data before the old one is retired.
Questions asked
Does the script create the six logins if they are missing on the destination?
No. Every statement references a principal that must already exist, so a missing login makes exactly that account's lines fail while the others still apply. Create missing accounts through the Historian installation or security configuration for the target release, then rerun only the failed lines. A same-named user inside Runtime is not evidence that the server login exists, because the two live in different scopes.
The destination already has a Runtime database from the fresh install. Can I keep it?
No. The migration procedure deletes that database first, because it is the one the fresh installation created and it holds none of your history, then restores your backup in its place. If the delete hangs because sessions are still connected, use the option to close existing connections and retry. Your data arrives with the restore, not with the placeholder.
Can I point the ownership line at my own administrator account instead?
Do not. The procedure names aadbo because the installation expects that owner principal, and ownership is a property of the database that outlives your session. Whoever owns it holds the fallback administrative rights on that database, including dropping it. If aadbo does not exist on the destination, create it through the release's configuration procedure and run the line unchanged.
Is the SQL-account security model still how current releases work?
It is the legacy model. Historian was long managed mainly through SQL Server users, newer releases rely on that mechanism far less, and it remains supported for backward compatibility. The script's purpose is to keep a restored database working under the model it was built with, not to convert it, so run it as part of the migration and treat modernizing the security design as a separate project.