Title: Where is database installer generated?
Last modified: August 21, 2016

---

# Where is database installer generated?

 *  Resolved [vmounts](https://wordpress.org/support/users/vmounts/)
 * (@vmounts)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/)
 * Hi,
 * Can you point me to the proper place(s) in the source code where the database
   install and search/replace code is generated? Depending on if I grok it, I might
   want to hack in some custom bits to help with moving my multi-site network.
 * [https://wordpress.org/plugins/duplicator/](https://wordpress.org/plugins/duplicator/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660480)
 * Sure! If you feel the updates would help the community please email me your code
   updates:
 * [http://plugins.svn.wordpress.org/duplicator/tags/0.5.2/installer/build/classes/class.serializer.php](http://plugins.svn.wordpress.org/duplicator/tags/0.5.2/installer/build/classes/class.serializer.php)
 * I hope to get the source into github later in the year to make it easier for 
   contributions…
 * Cheers~
 *  Thread Starter [vmounts](https://wordpress.org/support/users/vmounts/)
 * (@vmounts)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660593)
 * Thanks. The stuff I would add would be related to some plugins I use so it may
   not be generally useful. My background is with dot net and MS SQL server so I’m
   a bit of a newbie in this arena as well. We’ll see how far I get.
 * I partly just wanted to see what the search replace code is doing because I was
   getting strange results. I use sub-domain based multi-site. I understand why 
   replacing [http://example.com](http://example.com) doesn’t properly update the
   subdomain URLs as they don’t match the string. When I changed the value to just
   be example.com without the http:// I got strange results where the domain showed
   up again after the first slash, e.g. [http://subdom.newexample.com/newexample.com/rest-of-path](http://subdom.newexample.com/newexample.com/rest-of-path).
 * Anyway, being such a newbie, I just wanted to step through things with a debugger
   and there was one minor change that would help with that if you are interested.
   My IDE passes a query string so that the XDebug debugger kicks in. On line 114
   of view.step1.php (which makes its way into installer.php) there is a line that
   say
    `url: window.location.href + '?' + 'dbtest=1',`
 * This doesn’t work if a query string is already there from the debugger, so I 
   changed it to
 * `url: appendQryString(window.location.href, 'dbtest=1'),`
 * and added a function
 *     ```
       function appendQryString(url, qryString) {
       	    var hasQryString = url && url.indexOf('?') !== -1;
       	    var separator = hasQryString ? '&' : '?';
       	    url += separator + qryString;
   
       		return url;
       	};
       ```
   
 * I’m not really sure where the proper place to add the function would be ,and 
   I’m not sure if there are other places where it needs to be used, but that would
   make the code a bit more debugger friendly. The only other thing I had to change
   was the timeout right above the url line but that’s obviously not something that
   would be appropriate to change permanently.
 * With the debugger now working I’ll let you know if I find anything that might
   benefit everyone using multi-site.
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660624)
 * Hey vmounts,
 * I’m actually a C# .Net developer by day as well 🙂 Thanks for the code snippet
   I’ll see how it might fit in…
 * Cheers~
 *  Thread Starter [vmounts](https://wordpress.org/support/users/vmounts/)
 * (@vmounts)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660661)
 * Cool. I guess that means there is hope for me yet. 🙂 Maybe that’s why I found
   your code so easy to read. You’re used to a more structured language.
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660679)
 * Yeah, PHP is not known for its elegant API, on the other hand their isn’t really
   a platform like WordPress (or at least close in size) in the .NET world that 
   has quite the following and community…
 *  Thread Starter [vmounts](https://wordpress.org/support/users/vmounts/)
 * (@vmounts)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660716)
 * After getting a chance to transfer my site to my development server again I really
   only ran into two small problems. Otherwise it is working great for multi-site!
 * How I used the installer:
    I edited the Old Url field during install and changed
   it from [http://mysite.com](http://mysite.com) to just mysite.com. I also changed
   the New Url from [http://newlocal.dev](http://newlocal.dev) to just newlocal.
   dev
 * I’m OK with the consequences of this because I have a local mail server and I
   don’t mind (in fact I prefer) if stuff like email addresses get changed.
 * The two problems were:
    1) On Step 3 the links to Save Permalinks, etc get double
   pathed. It only happens on the installer page and not anywhere in the database
   or pages. The reason is that when the code builds the href for those links my
   New Url no longer starts with http:// , or a slash, so the browser thinks it 
   is a relative link. Relative to where installer is running so, [http://newlocal.dev/newlocal.dev/permalink-blah-blah.php](http://newlocal.dev/newlocal.dev/permalink-blah-blah.php)
 * Not sure that is even worth fixing since it is easy enough to just copy, paste
   and correct it in the address bar.
 * 2) The other was a bit more tricky. I use the chrome browser and it apparently
   doesn’t like (and doesn’t store) cookies for the localhost. Now my local site
   isn’t named localhost but the “cookie domain” was showing up as just a dot ‘.’.
   WordPress wouldn’t let me log in because it thought I didn’t have cookies enabled.
   This could potentially be something about my particular setup, but I did find
   out a lot of people have run into similar problems with chrome and local development
   servers.
 * What fixes it is adding a line to wp-config.php that says,
    define(‘COOKIE_DOMAIN’,‘.
   newlocal.dev’); The leading dot is important so that it works for sub-domains
   too.
 * Again, not sure if you think that is something worth fixing or how you would 
   want to do it. I was thinking maybe another check box under advanced options.
   The code would of course have to strip off any http:// if there was one and add
   the leading dot. I could take a crack at it some time if that sounds like a reasonable
   approach, but it isn’t critical as it is easy enough to just do manually.
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660719)
 * Hi vmounts,
 * Thanks for the overview. I’ll add these to my todo list, which is rather long
   right now 🙂
 * Again, thanks for the details!
 * Cheers~

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Where is database installer generated?’ is closed to new replies.

 * ![](https://ps.w.org/duplicator/assets/icon-256x256.png?rev=2906985)
 * [Duplicator - Backups & Migration Plugin - Cloud Backups, Scheduled Backups, & More](https://wordpress.org/plugins/duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicator/reviews/)

## Tags

 * [change URL's](https://wordpress.org/support/topic-tag/change-urls/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * 7 replies
 * 2 participants
 * Last reply from: [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/where-is-database-installer-generated/#post-4660719)
 * Status: resolved