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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a Project 1

Status
Not open for further replies.

AmerFund

IS-IT--Management
May 11, 2000
8
0
0
US
I have a project with database. I want to create a completely standalone copy of this existing project in a new directory in order to try various changes without affecting the original. I want to copy everything, database, tables, form, reports with new project/file names. Is there a simple way to create such a copy (SAVE AS for project is not enough...) - I know paths must be handled, tried to remove and re-add files but always wind up with some errors. I would appreciate a procedure to do this (I realize it may involve changes within the program code and/or database/tables). Thanks.
 
AmerFund

One way would be:-

Quit FoxPro
Use Windows Explorer
Right click on folder containing project
Copy
Right click on relevant drive
Paste
Rename "Copy of ..." to relevant new folder name

Your project has been effectively cloned

Chris
 
I concur w/ Chris. Explorer is the easiest way... Infact I keep working copies of most projects at various design phases that way If you need to revert something it is a matter of copy paste only.


-Pete
 
To Chris and BlindPete

Thank you for replies.

I may not have made my question clear. I want to copy the project in order to make fully operational variations complete with separate database, files, etc. In other words, MainProject, MainProjectA (separate executable, separate data, but based upon copy of MainProject with minor changes or settings). Copying the files is not a problem and answering 'Yes' to 'Make this directory NEW home for project' helps - but I would like to have new file names and new database (ie, break all connections, paths and file references to original project). There may not be any easy way to do this.

PS - I don't know if reply to your own post is proper in this forum or if this reply should have been posted against the above replies. Apologies if this is not correct way. Thanks again for trying to help.

Gene
 
People reply to their own posts all the time. Post On!

Hmmm... your problem is more complex than I realized. You can still copy the floder your project is in and then rename the copied project file with SAVE AS in VFP file menu.

In order to copy everything you need to stucture your project appropriately. For every project I have three folders.
1) Project MyAppName
2) MyAppName
3) Distr MyAppName

1) is all the source code, forms, classes, data, graphics etc for my project. The project file itself is in the folder "Project MyAppName" I then have subfolders for graphics, reports, data, etc.

2) is the for the installed app. What the app will look like after it is installed.

3) is the output folder for the Setup Wizard's distribution files.

Basically if you copy the folder "Project MyAppName" to another location. It is a complete independant project even though it has the same name. Use the save VFP File menu SaveAs to rename it.
-Pete
 
Gene,
I had a similar situation, and also needed to make sure there weren't "cross" references between the projects. Assuming you don't have any hardcoded links in your code, I may have a solution for you.

I wrote two utilities - one that saves off (most) all of the project info into two ASCII text files, and one that can recreate a project using these files. The great advantage is that you can simply use a "Find and Replace All" technique to change the paths in the text files to "move" the project references.

I've put the files up on our local user group web site ( in the PROJUTIL.ZIP file. This is actually part of my presentation for our next meeting. If there are any questions that the .TXT file don't answer, please post back (or if you do some exploring there, you'll probably figure how to contact me directly).

Note: Because it uses the Project object (also VARTYPE() and STRTOFILE()), you'll need to be working in VFP 6.0.

Rick
 
I use string variables to hold the paths. E.g.:

path2data = "U:\Database\"
path2repts = "U:\Reports\"

custprofDB = path2data + "CustProfile.DBF"
orderDB = path2data + "Orders.DBF"

salesrpt = path2repts + "SalesRpt.FRX"


This allows global reference changes to be made very easily.

Shanachie
 
Shanachie,

Thanks. Yes, I do exactly the same thing. This takes care of paths within code but does not address the issue of project file references. Thanks again for post.

Gene
 
I had a similar problem, where there were links between class libraries after I copied a project. That is, the parent of a class in library B would be a class in library A. I solved it by temporarily renaming the top-level directory where the original project is. Then I used the class browser to review all the classes in my library - it was easy to see which ones weren't properly linked to their parents. I modified and saved each of these and watched them jump back to the proper place in the class hierarchy. Then I put the name of the original directory back to what it was.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top