-
- Expert
- Posts: 230
- Liked: 41 times
- Joined: Feb 18, 2011 5:01 pm
- Contact:
Manually updating MoRef IDs
We upgraded a standalone VMware host from 5.5 to 6.7 which was the target of our replication jobs and housed about 35 replicas. In this situation the unique VMware identifier (MoRef) for all the VMs changed, and it's the MoRef that Veeam uses to track VMs. Veeam does provide a tool to change the old MoRefs to the new MoRefs. However, even with the tool the first replication after the change will still recalculate the digests, which would have taken a very long time. So we manually updated the MoRefs in the Veeam SQL database, and wrote up a how-to.
Please note, our datastore didn't change so the CBT data was still valid. If the datastore has changed, then the CBT data is invalid, and you want new backups/replication to avoid data corruption.
This process can also be used to prevent backup jobs from seeing a new VM and performing a full backup instead of an incremental.
NOTE: To directly edit query results in MS SQL, select “Edit Top 200 Rows” for the table you want, then in the tool bar click the “SQL” button which opens the query pane. You can then put your query in that pane, run it to update the results below, and directly edit them.
1. Before upgrading, connect to the host via PowerCLI and run the command below to output a list of VMs and their IDs. Save this data.
Get-VM | Get-View | Select-Object Name,MoRef
2. Upgrade the host, add the VMs to inventory, then re-run the command to find the new MoRefs.
3. Open the Veeam console go to “Inventory”, then properties on the upgraded server. Go to the “credentials” page and click “Apply”; if you need to update the credential information do it before clicking “Apply”. On the certificate prompt click “Continue”, and then finish. Once it’s done updating the host information, close and re-open the console.
4. Open SQL Management Studio on the Veeam backup server, look at the [Hosts] table, and record the ID of the target host you upgraded.
SELECT * FROM [VeeamBackup].[dbo].[Hosts]
5. If you have replication jobs whose replicas are on the upgraded host, edit the [Replicas] table and update the old replica MoRef in the [target_vm_ref] column with the new replica MoRef. If a VM has multiple replicas on multiple hosts, reference the [target_location] column to locate the correct VM. If you’re only updating backup jobs you can skip this step.
SELECT * FROM [VeeamBackup].[dbo].[Replicas]
6. Edit the [BObjects] table. Display all rows from the [host_id] of the host you upgraded and update the MoRefs in the [object_id] column. If you have an old MoRef for a VM which doesn’t exist anymore and would duplicate one of the new MoRefs, increase its MoRef out of the range of IDs used, e.g. IDs “100003’ and “100004” below.
SELECT * FROM [VeeamBackup].[dbo].[BObjects] WHERE [host_id] = ‘<Upgraded Host ID>'
7. Commit any SQL changes and restart the backup server. Run your backup and replication jobs; they should run normally, just like before the upgrade.
NOTE: If you already upgraded your host without recording the MoRefs first, you can still find what the old MoRefs were. If you refer back to step 6, you can resolve the unique ID for the VM in the [id] column to the VM name by finding that unique ID in the [BObject_id] column of the [BObjectsSensitiveInfo] table.
SELECT * FROM [VeeamBackup].[dbo].[BObjectsSensitiveInfo] WHERE [BObject_id] = '<VM unique ID>'
Please note, our datastore didn't change so the CBT data was still valid. If the datastore has changed, then the CBT data is invalid, and you want new backups/replication to avoid data corruption.
This process can also be used to prevent backup jobs from seeing a new VM and performing a full backup instead of an incremental.
NOTE: To directly edit query results in MS SQL, select “Edit Top 200 Rows” for the table you want, then in the tool bar click the “SQL” button which opens the query pane. You can then put your query in that pane, run it to update the results below, and directly edit them.
1. Before upgrading, connect to the host via PowerCLI and run the command below to output a list of VMs and their IDs. Save this data.
Get-VM | Get-View | Select-Object Name,MoRef
2. Upgrade the host, add the VMs to inventory, then re-run the command to find the new MoRefs.
3. Open the Veeam console go to “Inventory”, then properties on the upgraded server. Go to the “credentials” page and click “Apply”; if you need to update the credential information do it before clicking “Apply”. On the certificate prompt click “Continue”, and then finish. Once it’s done updating the host information, close and re-open the console.
4. Open SQL Management Studio on the Veeam backup server, look at the [Hosts] table, and record the ID of the target host you upgraded.
SELECT * FROM [VeeamBackup].[dbo].[Hosts]
5. If you have replication jobs whose replicas are on the upgraded host, edit the [Replicas] table and update the old replica MoRef in the [target_vm_ref] column with the new replica MoRef. If a VM has multiple replicas on multiple hosts, reference the [target_location] column to locate the correct VM. If you’re only updating backup jobs you can skip this step.
SELECT * FROM [VeeamBackup].[dbo].[Replicas]
6. Edit the [BObjects] table. Display all rows from the [host_id] of the host you upgraded and update the MoRefs in the [object_id] column. If you have an old MoRef for a VM which doesn’t exist anymore and would duplicate one of the new MoRefs, increase its MoRef out of the range of IDs used, e.g. IDs “100003’ and “100004” below.
SELECT * FROM [VeeamBackup].[dbo].[BObjects] WHERE [host_id] = ‘<Upgraded Host ID>'
7. Commit any SQL changes and restart the backup server. Run your backup and replication jobs; they should run normally, just like before the upgrade.
NOTE: If you already upgraded your host without recording the MoRefs first, you can still find what the old MoRefs were. If you refer back to step 6, you can resolve the unique ID for the VM in the [id] column to the VM name by finding that unique ID in the [BObject_id] column of the [BObjectsSensitiveInfo] table.
SELECT * FROM [VeeamBackup].[dbo].[BObjectsSensitiveInfo] WHERE [BObject_id] = '<VM unique ID>'
-
- Product Manager
- Posts: 14844
- Liked: 3086 times
- Joined: Sep 01, 2014 11:46 am
- Full Name: Hannes Kasparick
- Location: Austria
- Contact:
Re: Manually updating MoRef IDs
Hello,
thanks for sharing this with the community. I know some customers who did similar things for VCenter migrations and everything worked fine.
But, keep in mind that normally Veeam will not be able to support deployments which had manual modifications applied to the configuration database (unless those changes were requested and/or made by Veeam Support).
Best regards,
Hannes
thanks for sharing this with the community. I know some customers who did similar things for VCenter migrations and everything worked fine.
But, keep in mind that normally Veeam will not be able to support deployments which had manual modifications applied to the configuration database (unless those changes were requested and/or made by Veeam Support).
Best regards,
Hannes
-
- Expert
- Posts: 230
- Liked: 41 times
- Joined: Feb 18, 2011 5:01 pm
- Contact:
Re: Manually updating MoRef IDs
I added a blog post with a couple more screenshots:
https://itlint.blogspot.com/2019/09/vee ... ching.html
https://itlint.blogspot.com/2019/09/vee ... ching.html
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Feb 17, 2020 11:19 pm
- Full Name: Oxiale
- Contact:
Re: Manually updating MoRef IDs
Hi,
Thanks for sharing.
If i don't have a list of VMs old IDs, what can i do ?
Can i find it in an old veeam backup ?
Thx for your help
Thanks for sharing.
If i don't have a list of VMs old IDs, what can i do ?
Can i find it in an old veeam backup ?
Thx for your help
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Manually updating MoRef IDs
Can you describe what you're trying to achieve - chances are, there is a approach simpler than manual database update? Thanks!
-
- Expert
- Posts: 206
- Liked: 41 times
- Joined: Nov 01, 2017 8:52 pm
- Full Name: blake dufour
- Contact:
Re: Manually updating MoRef IDs
there is another option besides manually updating the moref ids. you can create a cname record in DNS pointing the old vcenter server name to the new one, the first pass will use cbt. restores work as well. you will have to edit all of the jobs, re pointing them to the old vcenter server name.
Who is online
Users browsing this forum: No registered users and 18 guests