8 Replies Latest reply on Mar 23, 2009 9:59 AM by philmodjunk

    How best to copy / import fields between databases?

    jprint714

      Title

      How best to copy / import fields between databases?

      Post

      Hi,
      I'm wondering what's the easiest way to copy / import certain fields from the sample database into my database.  (A user from another forum kindly uploaded a sample database that offers a great template for certain fields (e.g., email, phone numbers, files) : http://filemakertoday.com/com/showthread.php?t=21093&highlight=jprint714&page=2 
       
      I am using FMP Advanced right now. Is there a benefit to copying v. importing tables & fields? Is one option easier or is there a better way to proceed? 

      Also, if possible, I'd like change the function of the red X's next to individual fields. At present, they're set to delete the records, but I'd prefer if they clicked off unused fields. Anyway, I'd appreciate any advice you could offer. Thanks so much for all of your help!

        • 1. Re: How best to copy / import fields between databases?
          jprint714
            

          Any ideas...?  Thanks! 

          • 2. Re: How best to copy / import fields between databases?
            philmodjunk
               jprint714 asks: Is there a benefit to copying v. importing tables & fields?

             

            Import records is an option that can do either operation for you. It can import data from one file's data to a table in your current file. It can also be used to create a completely new table with all the field definitions and then copy all the data into it all in one step. Thus, it is quite a useful tool.

             

            On the other hand, if you don't pay attention to what import options you've selected, this same capability can really mess up your file. Thus, its a good idea to read the help file on this tool first so you understand all the details.

             

            If I want the table and the data it contains, I use File/Import Records/File and select "new table" as my target. If I just want the field definitions and not the data, I'd use Advanced's ability to copy and paste table schema.

            • 3. Re: How best to copy / import fields between databases?
              jprint714
                

              Thanks very much for your help. Am still trying to work out the kinks...

              I've copied and pasted the email field I'm trying to reproduce in my original database (the field itself has three overlapping fields). And I've copied and pasted the table that corresponds w/ those fields. When I go to layout mode, I select the outer part of the field, select "portal setup" and then try to select the Email table. But it doesn't appear in the drop down window under: "Show related records from" 

               

               I've been told that I need to relate my "people" table with the email table, but don't have anything like a PeopleID field or a People table -- I've simply modified the Contact Management template that came w/ FMP.  Anyway, here are my follow up questions:

               

              t me follow up w/ the following questions...

              -As I said, I don't have a PeopleID in my database. The only thing that looks remotely similar is the Identification Number. Should I copy a PeopleID field from a template and paste it in my fields under Manage Database? And then follow the relationship fields from there...? Here again is the database I'm trying to copy FROM: http://filemakertoday.com/com/showthread.php?t=21093&highlight=jprint714&page=2

               

              -Is there any way to easily import my old emails from my old email field into the new one? I have almost 700 records -- that's all...


              Thanks again! 

              • 4. Re: How best to copy / import fields between databases?
                philmodjunk
                  

                "Is there any way to easily import my old emails from my old email field into the new one? I have almost 700 records -- that's all..."

                 

                Trying using import to move over 700,000 records :smileysurprised:

                 

                Are both fields in the same table?

                 

                If so, you can use the replace command to copy from one field to another record by record.

                 

                If they are in different tables,

                 

                are you adding 700 new records or updating 700 records with new info in the email field?

                 

                There's significant difference in what to do depending on your answer to this question.

                • 5. Re: How best to copy / import fields between databases?
                  jprint714
                    

                  I'm trying to first copy a new email field (or set of fields for entering email addresses), and am so far having a lot of trouble doing so...  Again, I'm told that I need to create a relationship w/ the email table that I'm copied and pasted into my database and People ID table that I don't yet have.  I'm trying to figure out how best to set this up before I do it...

                   

                  Anyway, once that's done I'll need to copy the emails from my old email field into this new, more complicated email field.  So, in answer to your question, the fields are in different tables. 

                  • 6. Re: How best to copy / import fields between databases?
                    philmodjunk
                      

                    Sorry for not reading more carefully.

                     

                    You could, if you're careful make a copy of your file and use import records to copy data from Newtable::emailfield to OldTable::email field, with "update matching records" selected. The challenge, as you've stated will be to first determine a way for the records to be "matching".

                     

                    Alternatively,

                     

                    Once you've defined a relationship between NewTable and OldTable that gives you a one to one match, you could also use Replace Field contents to copy the field contents from Newtable::emailfield to OldTable::emailfield.

                     

                    Read the help information on both options and see what looks best for your data.

                    • 7. Re: How best to copy / import fields between databases?
                      jprint714
                        

                      Thanks very much. Well... I fear the structure of my database might have some fundamental flaws or missing parts. I simply have a Contact Management table, which contains all of my 56 fields, and now a copy of the Emails table that copied from the other template.  But it's not possible to create a relationship between the two tables since I don't have a People table that contains the necessary ID field that would link my Contact Management table w/ my Email table. 

                       

                      As I've grown to better understand FMP, I realize that I probably should've created more tables instead of dumping all fields inside of the Contact Management table. I've taken this route because it has been an easy way to set up my database, and I frankly have a remedial understanding of FMP. But I'd like to better understand how to set them up since I think they'd help w/ creating helpful relationships for the many fields I've set up!

                       

                      Anyway, I'm trying to figure out the best solution given my current configuration... 

                      • 8. Re: How best to copy / import fields between databases?
                        philmodjunk
                          

                        Studying up on relationships is a good idea. Perhaps another forum member can recommend a good "how to" book on Filemaker that would help you. Note that it is possible to split a large table into 2 or more different tables without having to start all over from scratch. Of course, you first need to figure out how to set up your relationships and what portion of your information from your old table should go into which new table.

                         

                        Thus you'll need to work out a good design "on paper" first.