Skip to main content

Duplicating and importing instances

Duplicating​

Duplicating an instance makes a new instance from a copy of an existing one on this server: a backup of the source followed by a restore into a new instance. The source itself is not changed.

It is an administrator-only operation, and it is a start of the New instance wizard: the Duplicate this instance button on an instance's page opens the wizard on Clone an existing instance with that instance chosen, and Start from on the wizard's Basics tab offers the same for any instance on this server. An old link to an instance's Duplicate page lands in the wizard the same way.

The normal uses are making a staging copy of production, and giving a developer a real dataset to work against - fanes.example.com copied to tissi.example.com, or to a throwaway under the server's wildcard such as test1.pelmo.example.com when it is wanted for an afternoon and no DNS change is worth making. See Host names and DNS.

A duplicate stays on its source's Odoo version. To try a newer version, use the instance's Upgrade tab instead: it prepares an instance at that version and rehearses on copies of production. See Upgrading an instance to a newer Odoo version.

The wizard takes the source's version, edition, classification and description, and never its names: the copy's FQDN(s) are its own. The Environment preset starts on Test (see below for what it may be), the Database tab keeps the source's databases by default, and the Certificate, Advanced and Review + create tabs work as they do for a new instance, DNS check included. Clone instance on the Review tab queues the backup and the restore.

The copy gets an Odoo master password of its own - the one Odoo's database manager asks for - and never shares the source's.

A duplicate is not a test of your backups

It is close, but it restores through a path you control end to end on one machine. A real drill restores onto a different server from the backup that actually left the server. See A disaster-recovery drill.

The production preset is not offered​

You cannot duplicate an instance into the Production preset, and the wizard does not offer it. The new instance would collide with the original on identifiers that are supposed to be unique, and two instances believing they are the same production instance is a worse outcome than a refused operation. A development instance may only be copied as another development instance.

Duplicate into a staging or development preset and promote it deliberately if that is what you want.

With the Test or Staging preset, the wizard shows Automatic git updates, off by default: switch it on and the copy's custom modules move to their branch heads and the instance restarts on its own. See Presets.

Importing​

ohm instance import restores an instance backup archive as a new instance: the command-line form of Restore from backup in the New instance wizard. -a, --archive names the archive and -p, --preset the environment preset.

Remote or localagainst pelmo
$ ohm instance import --archive instance-backup-fanes.zip --preset staging

Importing a configuration is a different thing​

ohm instance import brings an instance with its databases. Import configuration on the instance list is a different act: it builds an instance from a configuration file exported elsewhere.

The import always creates a new instance and never adopts the databases of the one the file came from. It is given its own id, its own addresses, its own database account and its own Odoo master password, and it routes to no database at all until you install it and activate one. Removing it later reaches only the databases it owns.

With the Test or Staging preset, Import configuration shows Automatic git updates, off by default; switch it on and, once the instance is installed, its custom modules move to their branch heads and the instance restarts on its own. ohm instance config import and ohm instance import take --git-auto-update for the same.

Keep id is for a configuration whose instance is somewhere else

Keep id hands the new instance the id recorded in the file. A configuration carries no databases, so this alone does not move an instance; to move one with its data, see Moving an instance to another server. On a server where an instance already carries that id, the import is refused: it would edit that instance instead of building one. Import without Keep id to build a copy beside it, or edit the instance on its own Configuration page.

The Production preset always keeps the id, so importing a production configuration back onto the server it came from is refused for the same reason.