Link to home
Start Free TrialLog in
Avatar of Jaziar
Jaziar

asked on

Copying Documents from One Database to another?

database 1 has created documents in it.  All the documents where created from a form named "Request Form".
database 2 has a form named "Main Topic".  I am wanting to use database 2, but I need to get the documents from database 1.  Both forms on the seperate databases share the same fields, but have differnt names.

Here are some thoughts i have

1.  Write a agent in database 2 that will go to database 1 and get all the documents and somehow change the name of the form they were created in?

2.  Copy over the Request Form and then copy over all the documents (cut and paste) add the form to the select statment in the views?

3. ??
Avatar of qwaletee
qwaletee

The easiest way is probably to copy+paste, and run a simple agen n the second database that only selects docs with form Request Form and changes Form to Main Topic.  Three minutes of work.
Avatar of Jaziar

ASKER

Will this work?

  1.      Click on Agents in the Design pane and then double-click an agent listed in the Work pane. The Agent Properties box appears.
  2.      Next to Trigger, check "On schedule."
  3.      Next to Target, select "All documents in database" and click Add Search.
  4.      In the Programmer's pane, click Formula and enter:
FIELD Form := "Reassigned form name";
where Reassigned form name is the name of the form that the documents should use.
Avatar of Sjef Bosman
Easier still, if you can allow the double formname: put an alias in the new form.
Call the form
    Main Topic | Request Form

Then it will always be called Request Form internally but Main Topic to the users..
Avatar of Jaziar

ASKER

2 good ideas
Avatar of Jaziar

ASKER

The Form already has a alias

Main Topic | Main Topic

Not knowing why it has one already - I wonder if it is safe to rename the second name?
Then give it another alias. The last name will be used internally in the Form-field.
Avatar of Jaziar

ASKER

Renamed the Form

Main Topic | Request and opened a document then renamed it back to
Main Topic | Main Topic and now when I try to compose I get the error:


Invalid | Nonexistant Document

All I did was change the alias nothing else
Does the second database already contain documents? If not, there's no problem, for both the formnames (name and alias) will match the form. It is not very practical to have to use both names in view selections, Script code, etc. So if there are documents with one name and there are documents with the other name, then convert them. If not, you can have a form name like
    Main Topic | Request Form
New documents will all get the internal name "Request Form", but the users will see "Main Topic" under Create Document.
Why rename it back??
Avatar of Jaziar

ASKER

There is no documents in the database
If you don't mind to live with the older internal name of Request, instead of Main Topic, then set the form's name as discussed above.

If you want all fields Form to contain "Main Topic", you need the agent.
Avatar of Jaziar

ASKER

Two things

First - thanks bosman for talking me in to going to one form verses the 3 I was using.  Makes things more simple.

Second - I can create the document from the create menu, but when I try to compose it from the action button gives me the invalid error
Avatar of Jaziar

ASKER

I got that working - NVM

I think I will try the agent and rename all the old documents
:)

Agent... Thought so. One thing: will it ever happen that documents are pasted from the old to the new database? Then make an agent with AfterDocumentsArePasted (or whatisname..), use UnprocessedDocuments and change the Form-field right after the documents are pasted.
Avatar of Jaziar

ASKER

Getting ready to try the Agent - keep you updated
Three minutes of work have tirned into 17 posts :(
Avatar of Jaziar

ASKER

Seems like that is the way most of my post works :(  I get the answers up front but have problems making them work
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial