Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-03-10 18:57:52

lindabb
Member
Registered: 2023-02-17
Posts: 132

Deplyment to hosting server

Now, almost I done with my textpattern site,
Are there any easy steps, recommendations to deploy developed site to hosting server using ftp account ?
as you know the site name (domain) and path saved in db table (txp_prefs) and config.php

Thank you

Offline

#2 2023-03-10 19:17:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,456
Website GitHub

Re: Deplyment to hosting server

In the old days (before Themes and development lanes) this was my approach moving from staging to live:

  • Put the live site in maintenance mode if you have that (plugin) available.
  • Log out of both the staging server and live server (if it’s already online).
  • Download all the staging site files via FTP.
  • Alter config.php connection details and path.
  • Backup the live database and check it’s output properly as a .sql file (if it’s already online).
  • Backup the staging database and check it’s output properly as a .sql file.
  • Edit the staging .sql file to alter the three (core) prefs in the txp_prefs table that contain paths or fixed domain information. Also tweak any plugin path settings.
  • Upload the site files to the live domain via FTP.
  • Restore the staging database into the live database.
  • Log in.

If your live server was already online while staging was in development and the article data has moved on, you’ll need to cherry pick the records from the original database backup and import them into the new live database. You can either do that once it’s live, or when you’re editing the staging.sql file, by adding the rows you need at that point.

This hassle is precisely why we invented the live/dev lanes, so this dance is not necessary and you can make changes to your site while the live data is still in situ. So hopefully, once your site is up, you’ll not need to worry about staging it when you make changes ever again.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2023-03-10 19:47:18

lindabb
Member
Registered: 2023-02-17
Posts: 132

Re: Deplyment to hosting server

Thank you Bloke,

Then I’m on the the right track , I thought there is kind of plugin or function to call after upload to ftp kinda re-configure server and paths.

This is my first textpattern, there are no textpattern files on the server yet, and no db for textpattern.

Here is what I did, (not uploaded yet) , I created php file on the hosting server to get server physical path
<?php echo dirname(FILE); ?>

replaced windows path on both config.php and db script (That I will import to the new db on the server) , and then replaced localhost/textpattern with my domain (without protocol ) just name.com

Will be nice to have one single re-configure php like setup to reconfigure the new server and then to be deleted after the configuration done. like upload.

I may do that later, steps will be as follow: (for new textpattern site only)
1-created new db on the hosting
2-Import from local scripted sql
3-Upload textpattern files (root) to hosting in most cases public_html
4-Include re-configure.php within above files.
5-point to the re-configure.php (on the hosted domain) domain.com/re-configure.php
6-Enter db name, user name nand password (just setup process) and path will be populated automatically by the script , save.
Remove or rename re-configure.php.
Finally update configure.php on the cPanel or allow re-configure.php to update it.
I think simple mysql connection will work

Thank you

Offline

#4 2023-03-10 20:30:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,456
Website GitHub

Re: Deplyment to hosting server

Yep. sounds good. If you don’t have a database set up already then you can just create one as you say, directly in phpMyAdmin (or equivalent tool) on your hosting platform. Use the utf8mb4 character set. And the same collation you used on your local environment.

If you prefer, you can upload your entire saved data files from staging to the server, and include the /setup directory. Then visit example.org/textpattern/setup and go through the setup wizard to create the database and generate the config.php, which you can then create/paste/replace inside your /textpattern directory.

You don’t necessarily need to complete the setup process any further (e.g. you don’t need to enter username details and theme, etc) because you will be overwriting the database anyway. But using the setup wizard to generate the config.php file so you can put the correct connection details in is a good check to make sure the database is accessible on your host. You’ll not need to do that in future at all because config.php will already be in place (and you’ll be using live/dev lanes anyway… right?!) ;)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2023-03-10 23:47:36

lindabb
Member
Registered: 2023-02-17
Posts: 132

Re: Deplyment to hosting server

thanks

Offline

Board footer

Powered by FluxBB