Jump to content
Antonis Savvidis

Can I keep local database of my repository?

Recommended Posts

I'm still rather new with Plastic but it seems lovely! So forgive me if that's somehow too obvious but I missed it.

 

Imagine this git example:

1. New git repository (local)

2. I add a file

3. I commit this

4. I remove that file

5. I commit this

 

The file is hidden in the .git folder existing at the same place, however in Plastic's case it doesn't as it keeps a central database in it's installation folder.

In git's case I can move that folder to another PC or keep it as a backup on a hard drive/blueray and not lose the repository.

 

How can I have that old-school safety with Plastic?

Share this post


Link to post
Share on other sites

Hi,

In Plastic, the local repos are stored by default at "C:\Program Files\PlasticSCM5\server\jet\rep_x".

You can use these databases as repo backups and move them to a different Plastic server to keep the repo.

Please let us know if it helps.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Thank you for the fast answer! However all I see there are rep_1...rep_n

1. How do I know which rep is which?

2. What if I move a rep folder, will I be able to change it's number when I bring it back to this or other system so it's automatically seen as another repo?

Thank you in advance!

Share this post


Link to post
Share on other sites
Quote

1. How do I know which rep is which?

Please run the fullowing command to match the repo name with the folder id:

cm lrep --format=TABLE
Quote

2. What if I move a rep folder, will I be able to change it's number when I bring it back to this or other system so it's automatically seen as another repo?

You can change the number and then link the database to the new server using the following command:

cm addrep --help

Please let us know if it helps.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Can you give an example of cm addrep?

 

In a local scenario, if "C:\Program Files\PlasticSCM5\server\jet\rep_x" is moved to "F:\Repos\rep_x"

What's the command to link it up?

cm repository add rep_x myname local ?

 

cm repository add F:\Repos\test\rep_4 another local
There has been an unexpected error "Invalid directory name: 'F:\Repos\test\rep_4'. It must start with 'rep_'". For more information check the server log.

 

Share this post


Link to post
Share on other sites

The command should be something like the following:

cm repository add rep_4 myrepository local

Regards,

Carlos.

Share this post


Link to post
Share on other sites

I tried copying rep_4 to another folder, then tried to add it as "mynewtest" but it failed.

So, I renamed the folder to rep_6 and tried to run the command again. It still failed.

C:\Docs\test>cm repository add rep_4 mynewtest local
There has been an unexpected error "Repository with ID 4 already exists.". For more information check the server log.

C:\Docs\test>cm repository add rep_6 mynewtest local
There has been an unexpected error "Repository rep_6 doesn't exist". For more information check the server log.

 

Share this post


Link to post
Share on other sites

Are you copying the "rep_6" it inside the "jet" folder? It seems it's not found.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Carlos,

Earlier in the thread we discussed copying the repo to a new folder and linking it up as a new repository. I've copied these to C:\Docs\test for testing.

I copied rep_4 and tried linking it with a new repo name, but it said it already existed.

I made a duplicate of rep_4 and called it rep_6, and it says it doesn't exist.

The concept discussed earlier in this thread is that we can work in a "distributed" way by copying the source folder (in jet/rep_x) to other locations, and link it up with cm repository add, but that is giving problems. Do you have a more comprehensive example of how that might be achieved?

Thanks.

Share this post


Link to post
Share on other sites

Hi,

In Plastic it's very important to differentiate between repos and workspaces:

https://www.plasticscm.com/documentation/user/plastic-scm-version-control-introduction-guide#:~:text=or SQL Server.-,Workspaces,the most recently created one).

The repositories (rep_x) are the databases and they are linked to a Plastic server.

If you want to follow a distributed workflow, you don't have to manually copy the repository databases between different Plastic servers. You can use the Plastic replica operation for that purpose.

If you actually need to move the workspace (not the repository):

If you actually need to move repositories from one Plastic server to other, you can move the "rep_x" folder and link it into the new server with "cm addrep --help" command.

Let's clarify first if you need to move the repo databases or the workspaces.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

I was trying not to get this thread off topic, as the OP's question was about moving a repository.

Quote

2. What if I move a rep folder, will I be able to change it's number when I bring it back to this or other system so it's automatically seen as another repo?

This is what I was trying to reproduce in this thread. I moved the rep_4 out of the "jet" folder and changed the number from 4 to 6 and tried

cm repository add rep_6 mynewtest local

But, it errored out. I'll read up on the replica idea and create another thread if that's applicable, but for now I was trying to finish up the initial concept of copying the repository to a different drive, and re-linking it with the Plastic server. That doesn't seem to work, can you provide a working example with the folder moved out of the "jet" folder?

Share this post


Link to post
Share on other sites

Hi,

Quote

This is what I was trying to reproduce in this thread. I moved the rep_4 out of the "jet" folder and changed the number from 4 to 6 and tried

The "rep_4" needs to be always inside another "jet" folder. If you want to move the repo from one server to the other. You need to move the "rep_x" folder from the original "jet" folder to the "jet" folder of your new server.

The repositories are always linked to a Plastic server.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Okay, with this information, I can now copy "jet/rep_4" to "jet/rep_6" and run "cm repository add rep_6 mynewtest local" and it successfully created a mynewtest repository inside of PlasticSCM. (Minor success! Yay.)

 

This is still on the C:\ drive. Is there any way to move the repository to a different drive?

On 1/26/2021 at 6:22 AM, calbzam said:

In Plastic, the local repos are stored by default at "C:\Program Files\PlasticSCM5\server\jet\rep_x".

So instead of C:\... move it to D:\... or F:\... etc. like "F:\jet\rep_x" ?

Share this post


Link to post
Share on other sites

Hi,

In the server webadmin you select the outout path for the databases. Or you can manually edit the "jet/jet.conf" file using the following entry:

basepath=c:\Users\maria\plasticdb

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Hello again.

I tried this:

My out put was

cm lrep --format=TABLE

 2 Caves 3d local

but I have folders rep_1 to rep_11 (I made/deleted a lot of repos doing tests). Does that "2" mean I'm actually looking for rep_2???

 

Share this post


Link to post
Share on other sites
Quote

 Does that "2" mean I'm actually looking for rep_2???

Yes, this is the id of the "rep_x" folder.

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...