Migrating a Project from CodePlex to GitHub
There are several steps you must perform to migrate a project from CodePlex to GitHub. Fortunately, they aren’t very complicated.
1. Install Git
Note: this step is not required if you are going to use the “fast way” to upload code to GitHub (discussed later).
If you haven’t already, install Git on your system.
You may also wish to install Tortoise Git, which provides a visual interface for Git.
Another tool you may find useful is the OctoTree extension for Chrome, which provides an easy-to-navigate code tree for GitHub repositories.
2. Create a GitHub Account
If you haven’t already, create a GitHub account on the GitHub home page.
3. Get the Source Code
The best way to do this depends on whether the project was included in the source code repository on VFPX or not. If you’re not sure, click Source Code on the VFPX home page and see if the project has a folder.
The project IS included in VFPX source code
If you use TortoiseGit:
-
Create a new folder on your system.
-
Right-click the folder in Windows Explorer and choose Git Clone…
-
For URL, specify:
https://vfpx.svn.codeplex.com/svn/FolderName
where FolderName is the name of the folder on the Source Code page of VFPX.
-
For Directory, specify the name of the folder you just created.
-
Turn on From SVN Repository and turn off all of the other checkboxes in the From SVN Repository section (this is important or the import will not work properly).
-
Click OK. The clone process takes a while, so be patient.
If you don’t use TortoiseGit, open a command window and type:
git svn clone --log-window=4000 "https://vfpx.svn.codeplex.com/svn/FolderName" "LocalFolder"
where FolderName is the name of the folder on the Source Code page of VFPX and LocalFolder is the path on your system where the repository should go. The clone process takes a while, so be patient.
The project IS NOT included in VFPX source code
If you have the latest version of the source code on your system, use it. Otherwise, download the latest release from CodePlex and unzip it into a new folder.
4. Migrate the Wiki Page
-
Go to the VFPX home page on CodePlex and sign in.
-
Click the Download Wiki link to download the entire VFPX Wiki content as a file named WikiFiles.zip (be patient; it’ll take a few moments as it’s over 100 MB in size).
Note: if you’d rather not download the entire content, email VFPX admin and let us know which project you want the files for, and we’ll email them back to you.
-
Unzip the file into a new folder. You may get some errors when you open the ZIP file because of some misnamed files; you can ignore those.
-
In the folder, you’ll find an MD file named for your project, such as FRXTabs.md for the FRXTabs project. There may also be image files using the project name, such as FRXTabs_home.png. Copy just these files to the project folder.
-
Rename the MD file to README.md. Note that if you use the “fast way” for uploading source code (discussed later), the case is important: “README” must be in uppercase and “md” must be in lowercase. If you don’t use the correct case, you’ll end up with duplicate readme files since you’ll let GitHub create one when you create the repository. If you use the “complete way” (also discussed below), the case is unimportant.
Once you’ve uploaded your project to GitHub, the content of this file, which contains text in Markdown format, appears automatically on your GitHub repository page.
Edit README.md. You can use a text editor such as Notepad but we recommend a Markdown editor such as Rick Strahl’s Markdown Monster. The content likely needs some editing. Here are some issues we’ve found:
-
Some images aren’t named correctly in the Markdown. For example, this is what the FRXTabs Wiki page looks like:
Here’s what the Markdown looks like:
Notice the “home” image, which should be FRXTabs_home.png, is referenced as FRXTabs_38209. Also notice FRXTabs_38236, which is supposed to be the image for the green line; there is no image file for that at all. You can either correct these errors or simply delete the image reference if they aren’t important (don’t forget to delete the image files you no longer need).
-
As you can see in the Markdown image above, links to CodePlex users, such as the “Project Manager” link, are links to CodePlex pages. You should change this to an email address (using “mailto:YourEmailAddress”) or GitHub user (“https://github.com/YourUserName”).
-
Most projects have a link to the latest release of the project. You can remove that since it isn’t needed.
-
Some projects, such as GoFish, have several Wiki pages. They may be converted to MD files or they may be HTML files. Either way, edit those files as well and correct the links between the files as necessary.
Some other suggestions for the content of the README.md file:
-
If a project manager isn’t specified, you may wish to add it so others know who you are and how to contact you.
-
It could list the release history and acknowledge contributors to the project. This information will be lost once CodePlex shuts down so preserving it here is important. It could be as simple as a filtered list of the content at https://vfpx.codeplex.com/wikipage/history or it could be more detailed.
5. Create a GitHub Repository
Your project can either be a repository under the GitHub VFPX organization or it can be a completely separate repository. The advantage of being under VFPX is that projects are automatically listed on the VFPX site, https://github.com/VFPX. However, all projects are listed on the VFPX projects list, https://vfpx.github.io/projects, so this isn’t necessarily a big advantage. The advantage of having the project in a separate repository is that you have full control over that repository, including who has push access.
Creating a Repository Under VFPX
Email VFPX project admin and ask us to create a repository under VFPX for your project. We’ll need to know your GitHub user name so we can give you permissions to the repository. We’ll create the repository and let you know when it’s ready.
Creating a Separate Repository
Create a GitHub repository and email VFPX project admin with the URL for the project so we can edit the project list with the new location. If you’re going the use the “fast way” to upload the source (discussed below), be sure to turn on the Initialize this repository with a README setting.
6. Upload the Source Code
You have a choice about how to upload the source to GitHub:
-
From SVN: if you cloned the CodePlex SVN folder as discussed in step 3, you just have a couple of things to do.
-
The fast way: just uploading the ZIP file containing the source code and the migrated Wiki content (README.md, images, and any other files). The downside of this approach is that there’s no version control so it’s more difficult for other people to collaborate on the project.
-
The complete way: a repository with full version control.
Instructions for each of these are below.
From SVN
If you installed Tortoise Git:
-
Add README.md and any image files to the repository: right-click the folder, choose Tortoise Git, then Add from the shortcut menu, and select the desired files.
-
Commit the new files: right-click and choose Git Commit -> “master” from the shortcut menu, enter a message in the Commit dialog (such as “Added README”), and click the Commit button.
-
Push to the GitHub repository: right-click and choose Git Sync. Specify Remote URL as:
https://github.com/RepositoryName.git
where “RepositoryName” is the name of the repository, such as “VFPX/FRXTabs”. Click Push.
If you don’t use Tortoise Git:
-
Open a command window in the project folder.
-
Add README.md and any image files to the Git repository:
git add . git commit --all -m "Added README"
-
Tell Git about the GitHub repository:
git remote add origin https://github.com/RepositoryName.git
where “RepositoryName” is the name of the repository, such as “VFPX/FRXTabs”.
-
Push to the GitHub repository:
git push -u origin master
The Fast Way
-
Click the Upload Files link to go to the Upload page.
-
Drag the ZIP file containing the project source code and the README.md along with any images and other MD or HTML files to the place indicated on the page.
-
Click the Commit Changes button.
The Complete Way
First, unzip the source code ZIP file on your system if you downloaded it from CodePlex.
Next, if you haven’t already, create text equivalents of your VFP binary files (PJX, VCX, FRX, etc.). There are several tools available to do this, including FoxBin2PRG.
Since files on GitHub typically have lowercase names, you may wish to rename your files to follow that standard (not a requirement, just a suggestion). Bulk Renamer can help with that.
It is important to set Case (4) to Lower, Extension (11) to Lower, turn on Subfolders in Filters (12), and select all the files and folders except README.md before clicking the Rename button.
If you installed Tortoise Git:
-
Clone the new GitHub repository for the folder: right-click the parent folder in Windows Explorer and choose Git Clone… from the shortcut menu. You may need to Manage Repositories if you have not set one up in Tortoise before to enter the GitHub Remote URL. Otherwise enter the URL for the GitHub repository. Adjust the local Directory as you see fit.
-
Copy the files from your local project, or from the ZIP file or SVN repository you downloaded from CodePlex into the new project folder. Overwrite or edit the README.md file as needed.
-
Add all necessary files to the repository, including README.md and other related files: right-click the folder, choose Tortoise Git, then Add from the shortcut menu, and select the desired files.
-
Commit the new files: right-click and choose Git Commit -> “master” from the shortcut menu, enter a message in the Commit dialog (such as “Initial commit”), and click the Commit button.
-
Push to the GitHub repository: right-click and choose Git Sync, and click Push.
If you don’t use Tortoise Git:
-
Open a command window and CD to the source folder.
-
Create a Git repository for the folder containing the source:
git init
-
Add all necessary files to the repository, including README.md and other related files:
git add .
to add all files to the repository or:
git add FileName
to add a file named FileName and repeat for the rest of the files.
-
Commit the new files:
git commit -m "Message"
where “Message” is the commit message.
-
Tell Git about the GitHub repository:
git remote add origin https://github.com/RepositoryName.git
where “RepositoryName” is the name of the repository, such as “VFPX/FRXTabs”.
-
Push to the GitHub repository:
git push -u origin master
7. Update CodePlex
Edit the project’s Wiki page on CodePlex and add a comment that the project has moved to GitHub, including a link to the project’s GitHub repository; something like this using Wiki markup:
!! Note: this project has moved to GitHub: [url:https://github.com/RepositoryName]