Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database move 2

Status
Not open for further replies.

DSummZZZ

Programmer
Oct 24, 2000
4,250
US
I've created and added databases to projects, but I have yet to move a database and tables from one server to another. Any gotcha's I need to look for?
More specifically, I wasn't sure if backlinks had servers and paths in them or if when tables reside in the same folder as the database container it only had a backlink to the DBC name.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Good question, Dave.

The main thing to remember is that all the paths stored in the DBC and the individual tables are relative. So, provided you maintain the relative structure of your folders, there is no problem in moving the database or the tables.

In particular, that means that, if the DBC and all the tables are in the same folder, you can move them to any place within the file system without any problem. Going further, if, say, the DBC is in one folder and the tables are in a sibling folder, the links would still work, even if you move the two folders to a different parent. It's only if the relative path between the folders changes that you will have problems with broken links.

As well as the paths, the tables store the actual filename of the DBC, and vice versa. So, if you want to change the name of the DBC or of any of the DBFs, you risk breaking the links. But you will avoid that if you make the change within VFP (either programmatically, or using the project manager or database designer), rather than in Windws.

Does that answer the question?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike has explained that well. The only thing to change is OPEN DATABASE, if you do that. When using DEs to open tables and the databse, a new path in SET PATH will help finding the new server, after you moved the files, which in itself is no problem, as Mike explained.

Bye, Olaf.



 
Mike,

Yes, perfectly. Thanks a bunch.
That's pretty much what I thought, but I just wanted to make sure there was nothing hiding from me.

Olaf,
Thanks also. I use a config (.INI) file and SET PATH, and there is no DE, so everything should work fine.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
As a follow-up for anyone who may be curious.
I have completed (well, save for changing a few shortcuts on individual desktops) my database move and everything went quite well.

A couple notable points though:
As Mike alluded to, tables that were associated with the database using relative pathing; i.e., no UNC path or drive letter, moved fine.

I had unwittingly created a couple tables using COPY STRUCTURE or CREATE TABLE using the full UNC path, something like
\\myserver\somevolume\somefile WAREHOUSE mywarehouse, and of course that reference was retained. Rather than mess around with trying to change the path on the files themselves, I just recreated the tables on the new server and APPENDed records from the old tables. So as long as you make sure to be in the correct directory and can avoid fully qualified path names when creating or copying tables, the path won't be included and moving the files will work fine.

My data warehouse is updated nightly, using FTP to download then append files from a 'mainframe'. This allowed me to run the nightly processing on both the old and new servers until I was confident the data on the new server was being properly updated. I know a lot of sites don't have that luxury, but it definitely made the transition easier with a 100% confidence level.

Again, thanks for the suggestions and comments.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top