Re: Creating a copy of a database -- best practice?

Author: mbsoftwaresolutions@mbsoftwaresolutions.com

Posted: 2019-02-28 at 15:37:06

On 2019-02-28 04:43, Peter Cushing wrote:

> On 27/02/2019 17:22, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:

>> I can easily do something like this:

>>

>> CREATE DATABASE C:\Backup\MyDBC.dbc

>> OPEN DATABASE C:\Production\MyDBC.dbc

>> liNumTables = adbobjects(laTables,'TABLE')

>> for ii = 1 to liNumTables

>> lcFile = forceext("C:\BACKUP\" + laTables[ii],'dbf')

>> use laTables[ii]

>> copy to (lcFile) database C:\Backup\MyDBC.dbc with cdx

>> use

>> endfor

>>

>>

>> ...and that would get me a copy of all of the tables with their

>> indexes.

>> Great. But what's the easiest way to get all of the DBC meta-data

>> into

>> that new Backup database copy? I can't USE the MyDBC.dbc and do a

>> COPY

>> TO as that only makes the result a DBF and FPT.

>>

> An easy way to get a copy of the data is to have a copy of all the data

> in another folder, then using your loop above, zap each table and

> append

> from the live data.  We use it here as a rough and ready backup during

> the day, while people are in the system.  Your copy then has all the

> same meta data as the original.

Hi Peter,

I see no difference between my COPY TO <the backup folder table> versus

doing an APPEND FROM <Production table> from my backup table. ???

Am I mistaken?

tia,

--Mike

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/57548c2cb0741015511f60d8bcfd55b7@mbsoftwaresolutions.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2019 mbsoftwaresolutions@mbsoftwaresolutions.com