How to backup and restore scm manager server? - version-control

I am having scm manager server i need to same setup and same code backup server.
so i am plaining to configured centos 6.3 server i was download it scm manager server. But how to backup old scm manager server full repository and full data, username and all.
Please help me.

If you want to take only repository backup, You can just write scripts to take backup of all repositories with simple steps.
Change the directory where you want to take backup of repos
git clone --mirror RepoURL
Restore -
change the directory where you have repo backup, if you are going to restore this repo in another server you need to change the origin url in config file
eg: Backup folder name is Backupmygitrepo.git, within this folder "config" will be available.
url = URLofNewOrigin
Execute below command for restore your repo-
git clone Backupmygitrepo.git restorereponame
This will restore repository with history.

Related

PlasticSCM repo do-over

What is the best way to start a PlasticSCM repo completely over from the beginning, but keep the same repo name? I am using Plastic Distributed Version Control and so far no other collaborators are using the repo.
If you mean a fresh start you can simply delete the repository and create a new one with the same name.
If you are concerned about Plastic SCM backup files, you don't have to worry about it, Plastic indeed doesn't like deleting stuff too fast so they keep a backup version (Which is also delete-able by admin/server owner). Creating a new repository with the same name will not affect the backup and will let you start a fresh repository with the same name.
Copied from Plastic SCM guide:
You can remove/archive a repository via command:
cm removerepository myproject#host:port
Note: the removerepository command does not delete the database in the database backend.
The repository database in the physical database backend name follows this pattern:
rep_xx.plastic
The file for myproject repository, in the previous sample, will be
rep_3.plastic
You can locate the database with the name in your database backend and back it up using the tool of your choice. After you have backed it up, you can delete the database from your backend if desired.
Reference:
plastic-scm-version-control-administrator-guide

sourcetree - Where are all the remote repository paths store?

I want to delete some repositories to free up my disk space, but I want to backup the remote repository path for future use. I know that we can find the local repository's source path at: C:\Users\<username>\AppData\Local\Atlassian\SourceTree\bookmarks.xml, but I don't know sourcetree stores the remote repository path in which file.
Those would be in your local .git directory which holds the repo configuration.
You can see it listed with git remote show origin.

github conflict when someone manually ftp files remote

Some one manually upload files directly to web server, as a result github is not same as the physical file contents in production.
And there are many files, I m afraid.
1 - Howto refresh the github master, so that it will show correct contents of the production server.
2 - And howto refresh my local dev according the refreshed github master in step 1?
You need to somehow copy all the files from the web server to your local repo: Git will detect the new/modified/deleted files in your local repo after that copy.
Once that synchronization is done in your local repo, add, commit and push to GitHub.

Migrate from bitbucket to GitLab

I have multiple repositories in BitBucket. What is the most appropriate way to migrate from BitBucket to GitLab?
For an example, I maintain a repo on my system named "SSSP". What should be my steps to have a clean migration of that repository from BitBucket to GitLab?
It is better to use an intermediate local bare repo in order to duplicate one remote repo and push it to a new remote one.
Assuming you have an empty gitlab repo ready:
git clone --bare git#bitbucket.com:old/old_repo.git
cd old_repo
git remote add new-origin git#gitlab.com:new/new_repo.git
git push --mirror new-origin
cd ..
git clone git#gitlab.com:new/new_repo.git repo
cd repo
# start working
Note that this won't include the wiki (which you need to clone as well if you have some content there), or the issues.
I suppose that using the import feature via web interface will be simpler than cloning and pushing each repo.
GitLab Documentation - Import your project from Bitbucket to GitLab
Also, Gitlab can import issues in that case.
I had this issue today and the links in the above answer out of date (404 Not Found). Finally I solved it and here's the steps how i made it and hope it helps for people who need it
Step1: Bitbucket
login your bitbucket account
got to Bitbucket settings
select OAuth(on left side menu)
select Add consumer
fill in details:
Name
description
Callback URL
URL
grant permissions
Account: Email, Read
Repositories: Read
Pull Requests: Read
Issues: Read
Wiki: Read and Write
save your changes
Now the key and secret are generated like:
Step2: GitLab
open gitlab.rb file as root using vim(you can choose your preferable editor)
sudo vim /et/gitlab/gitlab.rb
initialize OmniAuth Configuration for initial settings:
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['saml', 'twitter']
gitlab_rails['omniauth_auto_link_ldap_user'] = true
gitlab_rails['omniauth_block_auto_created_users'] = true
add Bitbucket provider configuration(key and secret we generated):
gitlab_rails['omniauth_providers'] = [
{
"name" => "bitbucket",
"app_id" => "BITBUCKET_APP_KEY",
"app_secret" => "BITBUCKET_APP_SECRET",
"url" => "https://bitbucket.org/"
}
]
save the changes to gitlab.rb file
run command gitlab-ctl stop, gitlab-ctl reconfigure and gitlab-ctl start to reconfigure the changes and restart gitlab.
Now you can see this confirmation modal:
I don't have 50 reputation so I can't comment but VonC is right. Spent about two hours trying to get GitLab's BitBucket import feature to work - I trashed it and simply added a new origin, re-pushed --mirror and deleted the older origin. When looking at the new GitLab server, I can see all the commits from the previous Git origin / server.
cd /dev-git-repo/
git remote add new-origin https://my-gitlab.my-gitlab-repo.com/myrepo-dev-git-repo
git push --mirror new-origin
git remote remove origin
Then you can test ...
echo "\r\nThis should be seen on GitLab not bitBucket" > README.md
git commit -m "updated readme.md"
git push new-origin
And you can see README was updated on gitlab and not on bitbucket.
In case you use bitbucket-server and gitlab-ce.
First, open gitlab-ce admin interface, create a new group bitbucket-import. Afterwords create a new project within that group so that the folder /var/opt/gitlab/data/repositories/bitbucket-import should get created.
Then, copy the bare repositories from bitbucket-server data folder to gitlab-ce data folder:
cp -r /var/atlassian/application-data/stash/shared/data/repositories/* /var/opt/gitlab/data/repositories/bitbucket-import
Rename all folders from {folder} to {folder}.git. Gitlab-ce needs the .git ending to import the repository.
/var/opt/gitlab/data/repositories/bitbucket-import/
rename -n s/$/.git/ * # Dry run
rename s/$/.git/ * # Renaming
Import the repositories:
chown -R git:git /var/opt/gitlab/data/repositories/bitbucket-import/
gitlab-rake gitlab:import:repos['/var/opt/gitlab/data/repositories/'] RAILS_ENV=production
Now, you can see the imported git repositories in your gitlab admin interface represented through bitbucket id's. Here is how you can lookup the real name:
http://your-bitbucket-stash-server/rest/api/1.0/repos?limit=1000&start=0
Go to gitlab-ce project settings -> Advanced and rename your repositories.
Kind regards.
1.git -c http.sslVerify=false clone https://user#bitbkt:8443/scm/config.git
Will create clone from bitbucket on Local machine(Need proper rights for cloning the data from Bitbucket)
2.cd config
after cloning go into base folder
3.git remote add sxm https://test.com/gitlab/xyz/config.git
Had created specific group on GitLab(xyz) and created config project in it.
4. git push sxm
Will push BitBucket code on GL Gitlab.

Eclipse Egit using remote system to add project with git support

I have a Server with SSH access. On this server I have a php/yii project including a git repository (so versioned with git). Is it possible to use the EGit Team Provider (which just works fine for local projects/ .git folders) for those remote projects?
I just get nullpoint exceptions with the wizard (Share project) and cant get EGit to recognize the existing git project.
Maybe could try this by creating a fresh test .git repo on a linux server, add a php file, use eclipse remote system to browse by ssh for the folder containing the .git folder, use right click on that folder->create remote project and then somehow figure out how EGit could be added...
EGIT doesn't recognize the repository if it doesn't end with .git extension
Login to the LINUX server
cd to path in which you want the repository in
mkdir your_project_name.git //This will create the repository
git init --bare //This will actually initialize the git repository
clone this repository
add files in the local repo
add files to index, commit and push to master