Sometimes you have to move a project to a new Subversion repository, or to a different place in the same repository. This might be because a server gets moved or decommissioned, or just because you're doing some cleanup or reorganization. In this video, I'll show you how to do that in Eclipse using the Subversive plugin.
- [Instructor] Something else you might have to do is move a project to a new repository, or a different place in the same repository. I'll show you how to do that in Eclipse. There are a few different situations that might cause you to move a project. Maybe your subversion server dies or it gets decommissioned. Or, the DNS name changes. Maybe you're just doing some repository clean up and you want your project to be in a different folder structure. That can happen when the SVN folder structure gets messy, or when you get a new project lead, or a manager who wants things done in a particular way.
Whatever the case, there are two possible solutions. One solution is that your admin moved or restructured everything for you. This one is easy. All you have to do is create a new Eclipse workspace, import the project from a new location as a new SVN project, and you're done. If you're lucky, this is what'll happen. Otherwise, you might be told that you have to move the project yourself. This could happen if you have a passive aggressive admin, or if you don't trust someone else to move the project for you, or because your manager tells you to. Or, maybe you're the one who wanted to change everything in the first place and it's more convenient to move everything yourself.
In that case, here's how to point your local working copy of a project to new location. Here in Eclipse, we have a project that's already connected to an SVN project. First, you need to disconnect your project from the SVN server. To disconnect, simply right click the project in package explorer. Choose the context menu option team. Disconnect. It's all the way to the bottom, so if your screen resolution is kind of low, you might have to scroll down through the menu a little.
When you do this, it'll ask if you also want to delete the SVN Meta information. Yes, you do want to do this. In every working copy of a project, there's a hidden dot SVN folder that contains information about the project. Like where it's stored on the subversion server or how to connect, and so on. You want to delete this information if you connect to a new location. Make sure the delete option is selected, and click yes. Now the SVN information in Package Explorer is gone. And, you just have a normal Java project.
The next step is to connect to the new project location, wherever that is. Right click the project again, and choose team, share project. Choose the SVN option, click next, and use the URL of the new repository you're pointing to. In this case, I'll go back to my visual SVN server. Right click my new repository. Choose copy URL to clipboard. And use that for the URL.
Create a new repository location. Click next. And paste in the URL. I'll add the username and password. And click the save authentication box. And then click next. Here we want to fill in the project locations so the new folder path at the bottom looks the way you want it to. In this case, we use a specified project name of moved project.
And the single project layout. This way we have the repository project named trunk layout like I like. When you click next, it'll prompt you to make a comment about why you're making the change. Either accept the default comment here, or enter something descriptive. Remember, this is the comment you make that corresponds to creating the new folder, not for uploading the files. Creating the folder and committing the files are two separate actions as far as SVN is concerned. When everything looks good, click finish. Now, we actually have to upload the files to the new SVN project folder.
We can select all the files, or just some of them. It depends on whether your team normally saves the Eclipse project class path in settings files with the SVN project or not. However you do it, select the appropriate files to save, and write a nice commit comment. Moving project to Repo2. And, I'll click ok. The project just got uploaded to subversion and you'll see that the Eclipse project in Package Explorer now has Meta information again indicating which repository this working copy points to and what revision you're currently using.
- Trunks, tags, and branches
- Checkout, commits, and revisions
- Merging, locking, and working with a team
- TortoiseSVN on Windows
- SVN integration with Eclipse
- Connecting to a project
- Creating a new Java project in Eclipse
- Connecting to an existing Java project using Eclipse
- Dealing with projects that move to a new location
- Making changes and creating branches
- Tracking changes and dealing with conflicts
- Creating a release