Move or restore a server
Private keys never leave the machine store, and DPAPI secrets only open on the server that made them. So a new server gets its settings from an export and its certificates from new orders.
- On the old server, if it still runs:
Keep the file and the password apart. Without
Terminal window $env:SSLENSE_CONFIG_PASSWORD = [System.Net.NetworkCredential]::new('', (Read-Host -AsSecureString -Prompt Password)).PasswordSSLense.Cli config export --file D:\move\settings.json --include-secrets --certificates D:\move\certificates.csv--include-secrets, only the general settings move. - On the new server:
- Install the MSI, set up the IIS sites and bindings, and open port 80 if you use HTTP validation.
- Run, with the same password in
SSLENSE_CONFIG_PASSWORD:Terminal window SSLense.Cli config import --file D:\move\settings.json --yes - Restart the SSLense service.
- Issue the certificates again:
- Run
SSLense.Cli bulk issue --file D:\move\certificates.csv --dry-runand fix whatever the checks report. - Run it again without
--dry-run. Production certificates need--accept-production-risk. - Certificates the file cannot describe are listed when it is exported. Add those by hand:
- certificates from other providers: install from the provider's files;
- manual DNS validation;
- certificates with no site;
- shared certificates.
- Run
- Add the deployment steps again for each certificate (
deploy add). They are part of each certificate, not of the settings. - Mind the rate limits: Let's Encrypt allows a limited number of duplicate certificates a week. For many sites, move in batches, or test with staging first.
- Retire the old server:
- Run
SSLense.Cli unmanage --site <name>for each certificate, or uninstall, so it stops renewing. - Revoke nothing unless a key may have been copied (compromised-key-or-account.md).
- Run
Restoring the same machine from a full system backup restores everything as it was, because DPAPI and the machine store come back with it. Run SSLense.Cli health afterwards.