Reputation: 401
I want to migrate this project https://code.google.com/archive/p/majesticuo to GitHub maintaining the history.
When i try to use the 'Export to GitHub' button, it says 'The Google Code project export tool is no longer available
The Google Code to GitHub exporter tool is no longer available. The source code for Google Code projects can now be found in the Google Code Archive.'
What would be the best way to do it manually? I have no svn knowledge and know a little bit of git. Thanks so much!
Upvotes: 23
Views: 3828
Reputation: 2845
Cherry-picking (heh!)
svnadmin
use,here are the steps I took with a project name $PROJECT
archived at https://code.google.com/archive/p/$PROJECT
, and with $GITHUB_NAMESPACE
the GitHub namespace you'd like to push the imported repository to.
wget https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/${PROJECT}/repo.svndump.gz
svnadmin create p
time zcat repo.svndump.gz|svnadmin load p
git svn init file://$(pwd)/p --stdlayout ${PROJECT}
cd ${PROJECT}
time git svn fetch --all
git remote add origin https://github.com/${GITHUB_NAMESPACE}/${PROJECT}
git fetch origin
time git push -u origin master
cd ..
rm -rf p repo.svndump
Upvotes: 3
Reputation: 30662
Updated 06 Nov 2017
It appears that you can recover and download the project's history in form of gzipped svn dump stream file. Follow these steps:
Example URL:
https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/majesticuo/repo.svndump.gz
The file is a gzipped svn repository dump stream file and you can use svnadmin load
tool to load it into a new repository.
Upvotes: 24
Reputation: 353
Just tested the accepted answer today and got the following error:
"Access denied. Anonymous caller does not have storage.objects.get access to google-code-archive-source/v2/code.google.com//repo.svndump.gz."
There is, however, a way to import it to git, including the commit history:
I just did it using an empty GitHub repository (created just for that, no README.md file) and it worked on the first try. The hg-git extension will generate a local branch on your git repo called "hg" that can be pushed to your Github remote.
Upvotes: 0
Reputation: 38872
Here is the procedure I performed lately to move Google Code archive of gil-contributions to GitHub repo, locally without any instance of Subversion server.
Follow bahred's explained to download the repo.svndump.gz
archive.
Create local Subversion repository and import the dump
svnadmin create /home/mloskot/svn
svnadmin load /home/mloskot/svn < /home/mloskot/repo.svndump
Checkout the Subversion repo to generate the authors file
svn checkout file:///home/mloskot/svn
and find one of many scripts to generate the authors.txt
.
Download latest SubGit from https://subgit.com
Read the SubGit importing guide, https://subgit.com/documentation/import-book.html
Initialize the Git repo where SubGit will translate the Subversion repo
subgit configure --minimal-revision 1 --layout std file:///home/mloskot/svn /home/mloskot/git
Edit the subgit/config
file generated in /home/mloskot/git/subgit/config
Import the Subversion repo into Git
subgit import /home/mloskot/git
subgit uninstall --purge /home/mloskot/git
Clone the Git repo, also as a verification step, and push it to GitHub
git clone --mirror /home/mloskot/git repo
cd repo
git config remote.origin.mirror false
git clone --mirror <GITHUB REPO URL>
git remote set-url origin <GITHUB REPO URL>
git push --all origin
git push --tags origin
Enjoy your code's new home!
Upvotes: 8
Reputation: 620
If you navigate to your project's page in Google Code, then click on "Source" in the sidebar, and then click on "source" inside the resulting page, you'll be taken to a page with a "Download" link. That will lead to a file called "source-archive.zip", which contains some sort of archive of your project--I'm not sure how complete that it, but it does contain some svn metadata. However, if change the last part of that URL from "source-archive.zip" to "repo.svndump.gz", you'll get an svn "dump" of your repo. That should contain the full history and be convertible to git format with various svn-to-git migration tools. (I figured that out based on information in this blog post, which also lists some suggested steps for the final conversion. But if your first attempt at converting the dump fails, try other tools; there are many options and there's a bit of an art to it if your repo history is complicated.)
Upvotes: 10