I just need existing Octopus (184.108.40.2064) to another server physical server with version upgrade (3.0.16).
I tried following ways:
- Export and import
- admin user was not in Administrators role
- variables for one environment not exists
- no releases was migrated
- backup sql db and restore sql db on other server
- server can not start due decryption errors
- if set old Octopus.Storage.MasterKey from config, when I get “CryptographicException: Key not valid for use in specified state.” in ProtectedData.Unprotect
So I have 2 questions:
- when I backed up my master key, how can I use it on another server?
- how can I migrate installation to another server without troubles?
Thanks for getting in touch.
The process here would be:
- Backup SQL Server and restore it on desired server.
- Install 3.0.16 on desired server. During installation, when asked for a database, point it to your restored database. It will detect that data exists, and prompt you for your master-key.
Keep in mind that the built-in package repository is not stored in the database. If you wish to move packages stored in the built-in package repository, you can simply copy them across. They are stored (by default) in C:\Octopus\Packages. You will also need to restart the OctopusDeploy service for it to re-index these packages.
I hope this helps. Don’t hesitate to ask if we can be of any further assistance.
Thank you, Michael!
I think it should be described in documentation, may in separate article (there are no one word about setting master key, only about backuping). Also I would add 3 step:
- Edit all your Tentacle installations Tentacle.config and update Tentacle.Communication.TrustedOctopusServers => Thumbprint value to new server thumbprint and restart Tentacle
You’re right, we haven’t documented that scenario. I’ll add it the list.
And you’re also correct about the final step. I apologize I neglected to mention it; I’m glad you figured it out.
I attempted to do a server migration this morning (for our dev server) and am having the same issue that Sabirov was having. Here are the steps I took:
- Stopped instance service on old server
- Installed Octopus on new server
- Configured instance on new server (applied master key from previous server)
- Started service on new server and received this error:
2015-09-02 08:56:48.0710 5 FATAL Unhandled AppDomain exception occurred: An exception was thrown while invoking the constructor ‘Void .ctor(Octopus.Shared.Time.IClock, Octopus.Core.RelationalStorage.IRelationalStore, Octopus.Core.Model.Logging.ILogEncoder, Octopus.Shared.Util.IOctopusFileSystem, Octopus.Shared.Util.ISemaphore)’ on type ‘ServerLogStorage’. —> The device is not ready.
(See inner exception for details.)
Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor ‘Void .ctor(Octopus.Shared.Time.IClock, Octopus.Core.RelationalStorage.IRelationalStore, Octopus.Core.Model.Logging.ILogEncoder, Octopus.Shared.Util.IOctopusFileSystem, Octopus.Shared.Util.ISemaphore)’ on type ‘ServerLogStorage’. —> The device is not ready.
(See inner exception for details.) —> System.IO.IOException: The device is not ready.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Octopus.Server.Orchestration.Logging.ServerLogStorage…ctor(IClock clock, IRelationalStore store, ILogEncoder logEncoder, IOctopusFileSystem fileSystem, ISemaphore atomicReadOrAppendSemaphore) in Y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Logging\ServerLogStorage.cs:line 50
at lambda_method(Closure , Object )
— End of inner exception stack trace —
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters) at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass51.<>c__DisplayClass7.b__4()
1.CreateValue() at System.Lazy1.LazyInitValue()
at Octopus.Server.OctopusServerEngine.Start() in Y:\work\refs\heads\master\source\Octopus.Server\OctopusServerEngine.cs:line 53
at Octopus.Server.Commands.RunCommand.Start() in Y:\work\refs\heads\master\source\Octopus.Server\Commands\RunCommand.cs:line 37
at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\AbstractCommand.cs:line 57
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.b__0() in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 21
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in Y:\work\refs\heads\master\source\Octopus.Shared\Startup\WindowsServiceAdapter.cs:line 59
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
Any ideas on what I can do to get past this error? (old & new servers are both Windows 2012R2)
I was able to remedy the error that I was having by doing the following:
In my old server:
Octopus was installed to D:\Program Files\Octopus\Octopus Deploy
Instance was configured to store packages and such to D:\OctopusDev
In my new server: (when I was having the issue):
Octopus was installed to C:\Program Files\Octopus\Octopus Deploy
Instance was configured to store packages and such to C:\Octopus\Dev
Whenever I would start the Octopus Service on my new server it would throw the exception that I posted previously.
I uninstalled and rebooted the new server, then changed the drive letter of my DVD drive and added an additional disk so that it would be my new D drive. Re-installed Octopus and configured it with the exact same locations as the old server.
Once I did that, everything worked.
Keep in mind, I did all of this while NOT backing up and restoring my database, I simply connected to the DB that already existed and stopped my Dev service on my old machine. That seems to have fixed it.
Furthermore, the entire reason that I have gone through the exercise of moving servers is because if you have two instances on one server and they use different certs.
The sites take on the “last cert that was applied in the Octopus Manager” regardless of what is showing in the Manager. This might be a bug that could / should be looked at.
In the meantime, I have simply split out my servers and am back up and going.