Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-02-24 00:18:10

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

documentation on moving to new server

I hope i am posting in the right thread.
Yesterday i moved my TxP based site to a new hosting server.

When i followed the instructions regarding:

“Handling the password
Changing your password after migrating your installation or upgrading MySQL.”

i found the documentation to perhaps being outdated.
First i found these instructions:
The main content area will now have a five columns labeled ‘Field’, ‘Type’, ‘Function’, ‘Null’, ‘Value’. The third row from the top should be called pass. At the far right is the encrypted value of your current password. Delete the contents of that box and type in your new password.

To not be applicable to the version of PHPMyAdmin i was using. I saw no option to reapply password. I simply ignored the whole change password issue and my site was fine and i could login into the Admin area.

Is the issue of changing passwords after moving to a new server no longer applicable?


…. texted postive

Offline

#2 2019-02-24 00:26:24

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: documentation on moving to new server

But one thing that i have discovered after moving is that the paths to my installation are not correct:

File directory path is not writable: /home/bopp/webapps/bopjet/files/.
Temporary directory path is not writable: /home/bopp/webapps/bopjet/textpattern/tmp.

How do I change the paths once i have loaded to my new server. plus i updated to 4.7.2

UPDATE: i edited the SQL file to change the paths to reflect the new server

Last edited by bici (2019-02-24 02:54:30)


…. texted postive

Offline

#3 2019-02-24 03:58:59

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: documentation on moving to new server

i deleted everything and reinstalled my sql file after changing all my paths to reflect the new server paths. i then imported the sql file, but the new installation shows OLD paths of the old server. what is going on!?

Document root: /home/bici/webapps/bopjet **
$path_to_site: /home/bici/webapps/bopjet **
Textpattern path: /home/bici/webapps/bopjet/textpattern **
Article URL pattern: section_id_title
Production status: testing
Temporary directory path: /home/bici/webapps/bopjet/textpattern/tmp **

Last edited by bici (2019-02-24 04:00:56)


…. texted postive

Offline

#4 2019-02-24 06:07:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: documentation on moving to new server

Hi bici

I guess you have changed the $txpcfg['txpath'] in /textpattern/config.php.

Other paths can be changed in Admin>Preferences>Admin.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2019-02-24 06:22:15

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: documentation on moving to new server

colak wrote #316702:

Hi bici

I guess you have changed the $txpcfg['txpath'] in /textpattern/config.php.

Other paths can be changed in Admin>Preferences>Admin.

… yes i had. but i forgot about all the Prefs that needed to be updated. Thanks for the heads up.
it works now except for CLEANURLs but i can live with that


…. texted postive

Offline

#6 2019-02-24 06:48:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: documentation on moving to new server

You might need some slight changes of the htacces file for clean urls. I’m sure that either somebody from your host or here might be able to help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2019-02-24 09:44:22

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: documentation on moving to new server

bici wrote #316697:

Is the issue of changing passwords after moving to a new server no longer applicable?

I suppose it’s good practice to change one’s passwords regularly, but yeah, I don’t think I ever do that when moving installations between hosts.

bici wrote #316700:

i deleted everything and reinstalled my sql file after changing all my paths to reflect the new server paths. i then imported the sql file, but the new installation shows OLD paths of the old server. what is going on!?

That sounds like you re-installed the old sql file with the old paths in it over your new installation with the new paths.

I generally do this:

  • look up doc_root. If you don’t know it already from the host’s directory tree, you can put a phpinfo file into the directory and call it up with http://yourdomain.com/phpinfo.php and then use the browser’s search function to find the line doc_root. Afterwards remove phpinfo.php again so other people can’t access it.
  • Update $txpcfg['txpath'] in config.php and check other details for completeness/correctness, e.g. define('PROTOCOL', 'https://'); (if you have an SSL certificate) or $txpcfg['dbcharset'] (along with the new database details of course).
  • Import the sql database.
  • With phpmysql or sequel pro, go into the txp_prefs table and sort by value.
  • Scroll down / page through the results until you find the entries with the paths. They should be all bunched together. Update them one by one, replacing only the doc_root part of the path.
  • Check if you need to update any other details, such as the site_url or urls or paths from plugins if your domain name has changed. They will likewise all appear together if you sort by value.

You can, of course, do that in Admin › Preferences. If I end up having to do this a lot during development, I make a little file I can run after importing the database that switches all the values at once.

EDIT: added a note about SSL for clarification.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2019-02-24 18:28:30

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: documentation on moving to new server

Thanks Jakob. i do use an INFO.PHP file which gives me the DOCUMENT_ROOT file path.

after creating the new SQL_DB on the new server i ensure that the collation is UTF8.
in my config file i have:

$txpcfg['db'] = 'my_database';
$txpcfg['user'] = 'name_boss';
$txpcfg['pass'] = 'secret'; 
$txpcfg['host'] = 'localhost';
$txpcfg['table_prefix'] = '';
$txpcfg['txpath'] = '/home/someuser/myweb.com/textpattern/';
$txpcfg['dbcharset'] = 'utf8';

but i have never added the protocol string in there:
define('PROTOCOL', 'https://');
should I ?

before i upload my old mysql file to teh new SQLDB i edit to change any server specific strings. then import into the new DB and it usually works fine.

But i must remember to update the prefs as well after logging to admin.


…. texted postive

Offline

#9 2019-02-24 19:35:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: documentation on moving to new server

bici wrote #316709:

but i have never added the protocol string in there:
define('PROTOCOL', 'https://');
should I ?

Hi bici, you have to define the protocol, only if your site has an https certificate.

ps. Which server did you eventually migrate to?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2019-02-24 20:36:31

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: documentation on moving to new server

colak wrote #316710:

Hi bici, you have to define the protocol, only if your site has an https certificate.

I do deploy Lets Encrypt on my domains.

i am advised to include this in a .htaccess file

which i add to the end of the htaccess tha t comes with the Texttpattern distribution :

RewriteEngine on
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^.well-known - [L]

ps. Which server did you eventually migrate to?

I finally chose to use A2Hosting.com in spite of having to use CPANEL. ugh! But I only use cPanel infrequently as i have good ssh access and i will set cron jobs to do backups and to deploy the backups to my Strongspace file space.

PS. very disappointed that there is no equivalent webfaction replacement. i think all the independents are being swallowed up by the big utilities. It feels like i have gone from a hip urban locale to the “bland sub-burbs”.


…. texted postive

Offline

#11 2019-02-24 21:07:45

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: documentation on moving to new server

bici wrote #316709:

define('PROTOCOL', 'https://');
should I ?

The define('PROTOCOL', 'https://'); means that Textpattern tags output https instead of http in the source code.

which i add to the end of the htaccess that comes with the Texttpattern distribution

Having a redirect in your htaccess is a good idea, particularly if the site existed previously without an SSL certificate. It also works even if you don’t have define(…); in config.php because it redirects all the links from http to https.

That said, I think you might have some errors in yours (the bit you posted looks like a redirect to www. when https is already active). I also put mine before the textpattern redirects, the logic being links get rewritten to https:// (and www. if also desired) first and then passed to Textpattern for processing.

I generally use the https rewrite code from html5boilerplate. Note the extra line(s) to allow .well-known (used by LetsEncrypt) and others to still be accessible via http.

That file also have some good variants for redirect to www or suppress www (note, for those you must include the env:proto bit at the top, or else edit your rules).

before i upload my old mysql file to teh new SQLDB i edit to change any server specific strings. then import into the new DB and it usually works fine

If you edit the dump of the old database to match your new paths before uploading, that should be fine. Your Admin prefs should then show as being correct.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2019-02-24 21:16:43

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: documentation on moving to new server

bici wrote #316711:

I finally chose to use A2Hosting.com in spite of having to use CPANEL. ugh! But I only use cPanel infrequently as i have good ssh access and i will set cron jobs to do backups and to deploy the backups to my Strongspace file space.

PS. very disappointed that there is no equivalent webfaction replacement. i think all the independents are being swallowed up by the big utilities. It feels like i have gone from a hip urban locale to the “bland sub-burbs”.

I’ve not yet moved over any clients from wbfaction but as I was looking for a UK-based host, I’ve been testing guru.co.uk. It’s also Cpanel (the newer variant) but like you say SSH-access is permitted and works for remote MySQL access, direct sftp etc. just fine. They have an email migration setup too, but I’ve yet to test that.

I was tempted to try out a cloud vps like webdock.io or upcloud.com (similar to digitalocean and co but european), perhaps in conjunction with runcloud.io as the admin area, but none of those options include email and finding a (non-google, non-microsoft, non-yahoo) alternative for just the 20+ email address quickly added up to much higher costs than a shared host that includes both.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB