Migration Guide: Plaintext to Encrypted Vault
This guide walks you through migrating your existing plaintext credentials to the encrypted vault.
Overviewβ
Radium previously stored credentials in plaintext at ~/.radium/auth/credentials.json. The new secret management system uses an encrypted vault at ~/.radium/auth/secrets.vault.
Migration Processβ
Step 1: Verify Current Credentialsβ
Before migrating, verify your current credentials work:
radium auth status
This shows which providers are configured and their status.
Step 2: Run Migrationβ
Start the migration process:
radium secret migrate
You'll be prompted to:
- Set a master password for the encrypted vault
- Confirm the master password
Step 3: Review Migration Reportβ
After migration, you'll see a report showing:
- Total credentials found
- Number successfully migrated
- Number that failed (if any)
- Backup file location
Step 4: Verify Migrationβ
Verify your credentials still work:
radium auth status
radium secret list
Step 5: Test Secret Accessβ
Test that secrets are accessible:
# This should work if migration succeeded
radium secret list
What Happens During Migrationβ
- Backup Creation: A timestamped backup of
credentials.jsonis created - Vault Creation: New encrypted vault is created with your master password
- Credential Transfer: All provider credentials are encrypted and stored
- File Deprecation: Original file is marked as deprecated (not deleted)
Backup Filesβ
Backup files are created with the format:
credentials.json.backup-<timestamp>
Example: credentials.json.backup-1702070400
Rollback Procedureβ
If migration fails or you need to rollback:
Option 1: Manual Restoreβ
- Locate the backup file in
~/.radium/auth/ - Copy it back to
credentials.json:cp ~/.radium/auth/credentials.json.backup-<timestamp> ~/.radium/auth/credentials.json - Remove the vault file (if created):
rm ~/.radium/auth/secrets.vault
Option 2: Use Migration Managerβ
The migration utility provides a rollback function (programmatic access):
use radium_core::security::MigrationManager;
let backup_path = PathBuf::from("~/.radium/auth/credentials.json.backup-<timestamp>");
MigrationManager::rollback(&backup_path)?;
Troubleshootingβ
Migration Fails with "No credentials to migrate"β
Cause: No credentials.json file exists.
Solution:
- Verify the file exists:
ls ~/.radium/auth/credentials.json - If missing, you may need to set up credentials first:
radium auth login
Migration Fails with "Invalid master password"β
Cause: Master password doesn't meet requirements.
Solution:
- Password must be at least 12 characters
- Must contain at least one letter
- Must contain at least one number or special character
Some Credentials Fail to Migrateβ
Cause: Individual credentials may be corrupted or inaccessible.
Solution:
- Check the migration report for specific failures
- Manually add failed credentials:
radium secret add <name> - Verify the original credentials file is intact
Vault Already Existsβ
Cause: Vault file already exists from a previous migration attempt.
Solution:
- If you want to start fresh, remove the vault:
rm ~/.radium/auth/secrets.vault - If you want to add to existing vault, use
radium secret addinstead
Post-Migrationβ
After successful migration:
- Original File: The
credentials.jsonfile is marked as deprecated but preserved - New Vault: All credentials are now in
secrets.vault - Backup: Original file is backed up with timestamp
Deprecated File Noticeβ
The original credentials.json file will have a deprecation notice added at the top:
// DEPRECATED: Credentials migrated to encrypted vault on <timestamp>
// This file is kept for rollback purposes only.
// Do not use this file - credentials are now stored in secrets.vault
// To rollback, restore from backup: credentials.json.backup-<timestamp>
Next Stepsβ
- Test Everything: Verify all your workflows still work
- Update Documentation: Update any scripts or docs referencing credentials.json
- Secure Backup: Store your master password securely (password manager)
- Clean Up: After confirming everything works, you can remove the deprecated file
Idempotencyβ
Migration is idempotent - you can run it multiple times safely:
- If credentials already exist in vault, they won't be duplicated
- New credentials in
credentials.jsonwill be added to vault - Existing vault credentials are preserved
Security Considerationsβ
Master Passwordβ
- Never share your master password
- Store securely in a password manager
- Use a strong password (12+ characters, mixed case, numbers, symbols)
- Remember it - there's no password recovery
Backup Filesβ
- Backup files contain plaintext credentials
- Store backups securely or encrypt them
- Delete backups after confirming migration success
- Don't commit backups to version control
Vault Fileβ
- Vault file is encrypted but still sensitive
- Keep file permissions at 0600 (default)
- Don't commit vault file to version control
- Back up the vault file separately if needed