Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

How to move your on-premise repos to Plastic Cloud

Tuesday, March 26, 2019 Sergio L. 0 Comments

Do you need to move your on-premise repositories to Plastic Cloud? This may happen if you run a Team Edition server in your office and want to go to Cloud Edition or simply backup your repos to a Cloud Extension. If that's the case, keep reading.

You need a Plastic Cloud account

Migrating from your on-premise server to Plastic Cloud is easy. The only tool you need is your Plastic SCM client.

I'll assume you already have a Cloud organization created, and that you have administration privileges on it. If not, you can read about Plastic Cloud Edition and contact support if you need to.

Now, let's quickly review the steps!

Configure your Plastic Cloud credentials

To use the Plastic Cloud, you will need to configure your client to point to the Cloud server or create a connection profile to identify yourself.

In either case, the address of your remote Cloud server is of the format <organization name>@cloud. For example, if the name of your organization is tardis, then your Cloud server address is tardis@cloud.

If you want to configure the client to point directly to the Cloud, you can use the clconfigureclient CLI tool...:

C:\> clconfigureclient
####--- Client configuration wizard ---####
Configuring language. These are the available languages:
1. English
2. Spanish
Choose a language (type a number): 1
------------
Configure the Plastic SCM server address/port:
Plastic SCM server address [localhost]: tardis@cloud
Detected working mode: LDAP
------------
Configuring LDAP connection...
LDAP user: sergio@domain.com
LDAP password: *************
------------
Configure a proxy server? [y/N]: n
------------
The Plastic SCM client has been correctly configured.

...or the Plastic SCM GUI:

If you want to create a profile, you can list the repositories in the Cloud server using the GUI, and when the client asks for your credentials, you can check the box that lets you remember the credentials as a connection profile:

If you are using the Windows client, you can create profiles by hand going to Preferences > Connection Profiles > Add.

Create the repositories in the Cloud

Now, you need to create in the Cloud the repositories that you want to migrate. Suppose you have the following repositories in your on-premise server:

C:\> cm repo list localhost:8087
master@localhost:8087
tfg@localhost:8087
tfg/code@localhost:8087
tfg/docu@localhost:8087

If you want to migrate all of them, you will have to create the counterpart repositories with the same name in the Cloud server:

C:\> cm repo master@tardis@cloud
C:\> cm repo tfg@tardis@cloud
C:\> cm repo (...)

You can check that everything went all right doing a lrep against the Cloud server:

C:\> cm repo list tardis@cloud
master@tardis@cloud
tfg@tardis@cloud
tfg/code@tardis@cloud
tfg/docu@tardis@cloud

Of course, you can do the same using the GUI. Just navigate to the Repositories view, change the server address, and create them as you'd usually do, or go to the Cloud view for the same (you'll find out they are pretty similar).

Create a sync view to replicate to the Cloud repositories

Now, you need to upload the data from the repositories stored in your on-premise server to their Cloud counterparts.

The simplest way to do so is creating a Sync View using the Plastic SCM GUI.

A Sync View is a collection of repositories that act as the source of the data with a series of remote repositories associated with them that would act as the destination of the data. The Sync View calculates the branches need to be pushed or pulled.

In the GUI:

  1. Find the Sync View in the left menu as Sync Repositories.
  2. Create a new Sync View by clicking + Add sync view. I'll call mine On premise to Cloud.
  3. For every repository in your on-premise server that you want to migrate, click the Add src repo button, selecting them from the list that will appear.
  4. For every repository in the Sync View list, select it and then click Add dst repo.
    1. In the dialog that appears, fill-in the Cloud server address (remember, organization-name@cloud).
    2. Click Search (Windows) or Refresh (GNU/Linux and macOS).
    3. Select the repository's counterpart.
    4. Click Ok.

Once your Sync View is in place, it should look like this:

When you click the Refresh button, the Plastic SCM client calculates which data needs to be transferred.

Once the calculation is over, click the Push visible button.

A shortcut to create sync views

Another choice you can use to create your on-premise to Cloud Sync View is:

  1. Navigate in the left menu to the Cloud view.
  2. Enter your Cloud organization address (1).
  3. For each remote repository (2), right-click on it and create a Sync View from the contextual menu (3):

Migrate the workspaces

Once your branches are pushed to Plastic Cloud, chances are you want to start working with them right away.

Your first impulse might be to delete your local workspace, creating a new one in the Cloud repository, and updating it. Resist the urge!

Migrating a repository does not mean you have to redownload all your data again to work with it. In Plastic SCM, workspaces are just directories synced against a point in a repository's history: a changeset, a branch (this is, the head changeset of the branch) or a label.

If your workspace is synced to a particular point in your local repository (let's say, the /main branch), we can switch to the same branch in the Cloud repository counterpart. The Plastic SCM client will traverse the associated metadata of your files, and then it will find out that the files in your workspace are exactly the same as in the remote repository, preventing it from redownloading them.

Remember to undo any of your local changes before continuing.

To migrate your workspace:

  1. Open the one you want to migrate (1) in your Plastic SCM client. Then,
  2. Navigate to the Repositories view (2). Change the server address to match your Cloud server (3).
  3. Select the Cloud counterpart (4).
  4. Right-click and select View Branch Explorer (5).

In the Cloud Branch Explorer, once you locate the branch that is loaded into your workspace, right-click on it and select Switch workspace to this branch. You will see that the operation finishes almost instantaneously, and the home icon will appear on the changeset. That's it! Your workspace is pointing now to a repository hosted in the Cloud.

That was easy, wasn't it?

Wrapping up

Migrating your repositories from an on-premise server to Plastic Cloud is really easy, and the only thing you need to do it is your regular Plastic SCM Client.

First, you just need to configure the client to access your Cloud organization. Then, you need to create the Cloud counterparts of the repositories you want to migrate. After that, the Sync View will take care of pushing your data auto-magically. And finally, you just need to browse the remote Branch Explorer and switch to the same object your workspace is pointing at.

The best thing is, none of these operations are new to you if you use Plastic SCM on a daily basis; but maybe you didn't think it would be that easy!

As always, if you had any problems following these steps, please feel free to leave a comment here, or ping us on Twitter at @plasticscm.

Sergio Luis
After an intense internship at Codice during spring and part of summer 2015, I joined the ranks of Plastic SCM as junior developer.
I already contributed code to the Plastic REST API, the HAL Slack bot that controls our CI system, migrated our internal main server to "new" hardware, coded an Android repo browser and hacked wifi-direct for the upcoming Plastic version.
You can reach me at @_sluis_.

0 comentarios: