Mautic Community Forums

Converting from subfolder to sub-domain

I’ve experienced several problems which always seem to get related back to the fact that I’m using mautic in a subfolder, ie.



https://www.mydomain.com/ma



so I decided to convert over to using a sub-domain, ie.



http://ma.mydomain.com



I’ve setup the sub-domain, deleted the cache, and can actually access the dashboard using the new domain. However, forms don’t work and trying to edit the configuration in the app just times out (the line across the top of the page animates for awhile then just stops with no page change).



Given I can’t edit the config through the app, I eventually found where I think it is stored: app/config/local.php



So I edited the site_url value in there to be http://ma.mydomain.com. I then cleared the cache again, but now when trying to access the dashboard using http://ma.mydomain.com I get an error page. the error_log contains:



[05-Jul-2017 10:36:04 UTC] PHP Warning: require(/home/mgroves/public_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory in /home/mgroves/public_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209

[05-Jul-2017 10:36:04 UTC] PHP Fatal error: require(): Failed opening required ‘/home/mgroves/public_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /home/mgroves/public_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209





It is correct in that those files (in fact, the whole doctrine folder) are not in the cache when it is regenerated with site_url set to a subdomain, while they are there when the cache is regenerated with site_url set to a subfolder.



So, I guess my questions is either:


  • what are the steps to convert a working subfolder install into a working subdomain install

    or
  • how do I trigger a regeneration of the app/cache/doctrine folder once I’ve changed to a subdomain.



    Cheers

    Malcolm

I’ve experienced several problems which always seem to get related back to the fact that I’m using mautic in a subfolder, ie.

https://www.mydomain.com/ma

so I decided to convert over to using a sub-domain, ie.

http://ma.mydomain.com

I’ve setup the sub-domain, deleted the cache, and can actually access the dashboard using the new domain. However, forms don’t work and trying to edit the configuration in the app just times out (the line across the top of the page animates for awhile then just stops with no page change).

Given I can’t edit the config through the app, I eventually found where I think it is stored: app/config/local.php

So I edited the site_url value in there to be http://ma.mydomain.com. I then cleared the cache again, but now when trying to access the dashboard using http://ma.mydomain.com I get an error page. the error_log contains:

[05-Jul-2017 10:36:04 UTC] PHP Warning: require(/home/mgroves/public_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory in /home/mgroves/public_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
[05-Jul-2017 10:36:04 UTC] PHP Fatal error: require(): Failed opening required ‘/home/mgroves/public_html/mydomain.com/ma/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /home/mgroves/public_html/mydomain.com/ma/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209

It is correct in that those files (in fact, the whole doctrine folder) are not in the cache when it is regenerated with site_url set to a subdomain, while they are there when the cache is regenerated with site_url set to a subfolder.

So, I guess my questions is either:

  • what are the steps to convert a working subfolder install into a working subdomain install
    or
  • how do I trigger a regeneration of the app/cache/doctrine folder once I’ve changed to a subdomain.

Cheers
Malcolm

Go to
https://your-mautic-installation-domain.com/s/config/edit

General Settings > Site URL
http://ma.mydomain.com

Save & Close
Then rebuild the forms.

Thanks for the help, but unfortunately that hasn’t got me much further.

Go to https://your-mautic-installation-domain.com/s/config/edit
General Settings > Site URL http://ma.mydomain.com

If I try and change the SiteURL via the config page, when I save I get the following error: “The CSRF token is invalid. Please try to resubmit the form.” When I check the config/local.php file, the change to the SiteURL has not been saved.

However, you got me a bit further. I changed it directly in config/local.php, deleted the cache directory, then hit http://ma.mydomain.com which brought up the dashboard. I could then get to the Forms page and batch rebuild all the forms. This successfully added the doctrine folder to the cache.

Still can’t edit the config in the browser (times out as per my original post) and even after altering the URL in the wordpress mautic plugin, forms don’t appear in pages.

Starting to think I might just have to do a full, clean install in a subdomain and migrate all my forms, contacts, campaigns, etc across. I hope there’s an export/import :slight_smile: