The Great Move....are you ever ready ?

So why the Problem Moving Files?

When one needs to move data from their CD to a hard drive, or from their school to home or to another school, ArcView tries to assist, but is often confused.

The reason is simple, the apr file writes a script that includes directions to the "project manager" where the location of the datasets you used in  your project are actually located. To the computer this means statements like:

Path:      "d:/gisprojects/history11/atlantic_links.shp" 

where d is the assigned drive letter (computer speak for the hard drive name. On a Mac it really has a name that you use.)
where gisprojects/history11 is the directory and sub directory where the file is located
and where atlantic_links.shp is the actual file that holds the data.

So when you move from one computer to another, the path or directions MUST stay the same or you have to issue new directions to the ArcView project file (the apr file). 

HINT: set up all your computers, at school, at home, at other staff you work with, in the same directory structure so the only thing that changes is the drive letter or name (on a Mac)

Also as you well know, every shp file needs to have an associated .shx and dbf file with the same name in order to function. They may also have additional associated files as well, but theses three need to stick together like glue to work. So if you move data, the "family" moves together all the time.

So how do I give these new directions to the apr file when I move data around ?

Step One

1. Set up all your directories and move all your data files first. Normally this means just a copy from your CD or from one drive to another. Keep the same directory structure always such as gisdata\history11

2. Copy your apr files to the new computer using the same directory structure such as your old machine, if possible. This is not critical like the data file structure as the apr file can be located anywhere, but the data structure needs to have consistency or you will have to change each location separately rather than a global change as you will be shown in Steps Two onwards.

Step Two

1. Understand that the apr file is really just like any text file and as such can be edited with most word processor. If you have a Mac, use SimpleText. If you have a PC, use WordPad to edit the file.

2. Start  your selected editor and open the apr file you want to change directions for. Just open it as any word processing document is done.

Step Three

1. Scroll down until you see the first line with the Path statement.

2. Now look at the path and record the drive name (letter) and notice that unlike the normal computer Operating System is uses forward slashes (/), not back slashes (\) in its code.

3. If the directories are not same as where you moved the data to, then record now where you have placed your files on a sheet of paper for use in Step Four.

Step Four

1. Now you are ready to do a global edit ......IF you created the SAME directory structure. If you did not, then you will have to go line by line ( a real pain) and change the drive letter and the directory name(s) for each line that contains a Path statement. But hopefully you followed the suggestions and did it the easy way. 

2. Select under "edit" , the "replace" feature from your word processor's menu. If you are using a different word processor, first locate the find and replace feature, and select it.

3. Now insert the former drive letter and / symbol in your "search for" or "find what" window, with the current drive letter and / symbol in the "replace with" window.

4. Select "Replace All" and you will get a message in some editors that tells you how many path statements were replaced

Step Five

1. Now save your work using "save as" to your "gisprojects" directory with the same name. It is now ready to open in ArcView as the apr file now knows where the data files have been moved to.

NOTE: If when you load an apr file in ArcView, you get messages such as "where is ****.shp" it is due to bad path statements. If you think you have only missed one, you can use the window to navigate to the correct location, but as you will have to do it two times for each theme in the project, you only want to do this if you missed one or two. Use the above method when you are getting a lot of missing links to your data.  

Also if you don't keep a similar file structure it will get to be a line by line search and replace typing exercise which is way TOO TEDIOUS for time poor teachers.