Home » Forums » DBManager General
 
Queries not ported when I migrate a DB from local PC to web server (1833 previews)
Queries not ported when I migrate a DB from local PC to web server Posted in 13th, 01/2006 08:59 by j_schatz
I used the Database Migration tool to port a development version of my database from my local PC to the web server where it will be used for production. The tables all seemed to make it OK but when I examine the queries, nothing is shown in the list.

I then opened the "create new query" window on the web server. I went to my local copy, listed the query, swept it with my mouse and copied it to the clipboard. Back in the "new query" window at the web server, I pasted the query into the editor window. I then attempted to save the query by the same name that it had on my local machine. I got an error message indicating that the object name was already in use. This implies to me that the querys did make it OK on the migration but DBTools is unable to list them.

I am using DBTools Professional Enterprise edition (3.2.1)with MySQL as the database engine.

Any idea what might be happening here? Thanks for your help.


Jim /
Re: Queries not ported when I migrate a DB from local PC to web server Posted in 14th, 01/2006 10:55 by support
Hi,

Queries are not copied when you move a database from one server to another. This is also true for reports, forms and diagrams. On the other hand these objects cannot have duplicated names due the catalog constraints to avoid problems. The solution to implement this is by linking the queries into the new database. This is a simple operation:

- right click the target database
- choose new => linked query
- choose the source query

and that's it. Now using this approach you can make change to the query in any of the databases and this will reflect for both cases.
Optionally you can have linked diagrams too.

Hope that helps,


Support / DBTools Software
Re: Queries not ported when I migrate a DB from local PC to web server Posted in 15th, 01/2006 02:15 by j_schatz
Support,

I tried what you had suggested and was able to link in my query. After linking it, I clicked on the Queries tab and was able to view my query. When I tried to execute the query, I got an error message about losing the connectin to the server. I then started writing this e-mail to describe the problem I was seeing. I then executed it again so I could get the exact text of the message but now the query is running just fine?? Let me link another one to see if it fails to run on its first attempt. OK, I just linked in another one and it worked the first time so guess there is no issue.

By the way, what is actually happening when I "link" in the query? The queries did make it in the migration because they are listed in the linking menu popup. Also, once they are linked, the source code for the query is all there. Why is the linking step necessary? Just curious.

Thanks again for your help.


Jim /
Re: Queries not ported when I migrate a DB from local PC to web server Posted in 15th, 01/2006 04:23 by support
Hi,

j_schatz wrote:
Support,

I tried what you had suggested and was able to link in my query. After linking it, I clicked on the Queries tab and was able to view my query. When I tried to execute the query, I got an error message about losing the connectin to the server.


This error usually occurs on remote connections. See that this can be configured in MySQL configuration file. Also try to set the Server Manager => Timeout value to 0.

j_schatz wrote:
By the way, what is actually happening when I "link" in the query? The queries did make it in the migration because they are listed in the linking menu popup. Also, once they are linked, the source code for the query is all there. Why is the linking step necessary? Just curious.

A query is an object that belongs to DBManager catalog and not to the database server. See that most database engines doesn't have catalog to keep this information. MSAccess seems to be the only one with this feature builtin. To avoid creating databases and tables in your server we have used a personal database, based on SQLite to keep all this information.
When you link a query to another database you are just creating a reference to that query into the target database. The code, name and its properties are exactly the same. So if you change the query code in one of the servers it will reflect into the other end. The migration wizard only copies the objects that belongs directly to the source database: tables, columns, indexes, domains, etc. User Objects like queries, diagrams, reports, forms are treated differently and referenced only internally by DBManager. The database server doesn't have knowledge of its existance.

Best Regards,


Support / DBTools Software
Re: Queries not ported when I migrate a DB from local PC to web server Posted in 16th, 01/2006 12:48 by j_schatz
OK, now lets see if I am really getting this.

In the design of the web site, I was thinking that rather than imbed SQL directly into coldfusion statements, I would instead imbed a query. This approach allows the testing of the query without involving coldfusion scripts. If the query is found to have a bug in it then I would fix the query and the coldfusion code would remain untouched (assuming no structure changes). This approach also supports the separation of work on a team; one member can focus on web page layout and the other on database design, maintenance and population.

As I understand your last reply, quires are not stored on the web hosting server but are instead fetched from my local PC where they are then executed against the database on the web server.

If I turn off my PC for the evening and go to bed, will the web server fail to render my clients web page correctly?
Jim
Re: Queries not ported when I migrate a DB from local PC to web server Posted in 16th, 01/2006 01:46 by support
Hi,

j_schatz wrote:
OK, now lets see if I am really getting this.

As I understand your last reply, quires are not stored on the web hosting server but are instead fetched from my local PC where they are then executed against the database on the web server.


That's correct.

j_schatz wrote:
If I turn off my PC for the evening and go to bed, will the web server fail to render my clients web page correctly?
Jim


Does your page references the query in your local PC? I think this is not the way to go. I would advise to keep your queries inside your scripts, or at least inside the database on a table designed for this purpose. See that DBManager won't handle these situations.

On the other hand you can still continue to use DBManager to update your queries and then copy them to the scripts or other place you choose to.

PS: We are finishing the DBTools Conquest, which is an IDE for web development. This IDE already has the builtin feature to update web scripts based on updated queries. We don't plan to support ColdFusion scripts though.

Best Regards,


Support / DBTools Software
Queries not ported when I migrate a DB from local PC to web server (1833 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » DBManager General