Migrating projects between version control repositories¶
If your organization has changed Git hosting services, and you therefore need to migrate projects from one supported version control repository to another, we recommend you follow this high-level process:
Prequisites:
Update the Anaconda Enterprise config map with the information required to connect to the external version control repository.
To run the project migration script, you’ll need Administrator access to a command line tool that can run bash or Python scripts on the master node of the Anaconda Enterprise cluster.
Ensure a recent version of
git
is installed on the master nodeYou’ll also need the origin Git host token/password, and destination Git host token/password.
Pre-migration setup¶
If you haven’t already done so, on the master node, change to the directory of the unpacked Anaconda Enterprise installer and install the bootstrap conda environment:
After the environment is finished installing, you may need to log out and log back in to activate the conda environment.
Temporarily disable reverse proxy authentication by adding the following key-value pair to the
git
section (outside of thestorage
section in the config map) of theanaconda-enterprise-anaconda-platform.yml
file used to configure the platform to use an external version control repository:This should look similar to the following:
Run the following command to restart the associated pod on the master node:
Create a user mappings file that maps Anaconda Enterprise user IDs to Git user IDs. This is a colon-separated text file where the first field is the AE user name, and the second field is the corresponding Git user name. For example:
Note
If you intend on migrating to or from a Bitbucket repository, you must use your
Bitbucket account ID
instead of yourBitbucket username
in theuser mappings file
.
Using the migration tool¶
Caution
Using the migration tool with https
instead of http
for the
internal storage may result in an SSL error.
Caution
If you are running a recent version of Gitlab Enterprise Edition (14.10+) you will need to use this version of the migration script.
The migration tool is a Python script, migrate_projects.py
, found in the AE5
installation tarball. It can be used in the following ways:
For example, the tool can be used in the following way:
To ensure tokens are not visible in bash history, they can be omitted and can be entered via stdin when running the script.
Note
The postgres password can be left blank. When migrating from Anaconda Enterprise, the origin-token
can be left blank.
When migrating to Anaconda Enterprise, the dest-token
can be left blank.
Post-migration cleanup¶
After the script finishes migrating the projects, re-enable reverse proxy
authentication by editing the key-value pair you previously added to the
git
section of the anaconda-enterprise-anaconda-platform.yml
file,
so it looks like the following:
Caution
If you do not re-enable reverse proxy authentication, Anaconda Enterprise will not work.
To verify that the new repository is being used by Anaconda Enterprise, edit an existing project and commit your changes to it.
Adding collaborators¶
If you’ve migrated to https://github.com, adding a user to a project as a collaborator sends them an email that contains an invitation to collaborate. Users must accept the invitation to be able to commit changes to the project repository. This does not apply to Github Enterprise.