Page 1 of 1

Moving Flatpress to a new location in 1.5.1

Posted: Sun May 03, 2026 12:47 am
by winddrifter
I've been using 1.3.1, and one of the things I loved about it was that I could take the complete blog folder and move it anywhere - different folder, copy it to localhost or upload to a new site, and it just worked - no fiddling required.

I upgraded to 1.5.1, and that is no longer true. If the configuration file does not show the exact complete url (or a blank), then changing anything about the url will prevent it from working. These are the kinds of error messages you may get:

"Fatal error: Uncaught Error: Failed opening required 'E:/htdocs/wdnew/blog150/fp-includes/fp-smartyplugins/\prefilter.postviews_assign.php' (include_path='E:/htdocs/blog152/') in E:\htdocs\blog152\fp-includes\core\core.smarty.php:275 Stack trace: #0 E:\htdocs\blog152\fp-includes\core\includes.php(19): fp_register_fp_plugins(Object(Smarty\Smarty), 'E:/htdocs/...') #1 E:\htdocs\blog152\index.php(3): include('E:\\htdocs\\..') #2 {main} thrown in E:\htdocs\blog152\fp-includes\core\core.smarty.php on line 275"

After about a day of trying various things, I believe I have a handle on it, and wanted to share what I learned for others who may have the same problem. I did a lot of experimenting by copying the install to a different folder name on my localhost, and figuring out what I needed to change.

Caveat: my fixes involve being able to edit config files directly, not through the interface. If you copy your install to a new location then these are the things you need to do to get it working again:

1. Edit \fp-content\config\settings.conf.php - at the top of that file you'll find something like

Code: Select all

$fp_config = array (
  'general' => 
  array (
    'www' => 'http://localhost/blog151',
You'll need to change the www url to the exact url of your blog. Note, I found you could also make this a blank entry (keep the quote marks) and it would also work. And with the blank url, you can move it anywhere without having to edit this file again. Note - trying to set this to blank in the
Admin menu (admin.php?p=config), a blank URL is not allowed by the interface. But you can set it to blank by manually editing this file. Even with a blank url, you'll still need the next step after moving.

2. After any change in location, delete \fp-content\cache\smarty_plugins.index.php - this contains links to the previous location, and delivers errors such as the one above if it is not deleted.

That should do it, and your blog should be working in the new location. If not, I found one time I also had to edit \fp-defaults\settings-defaults.php to correct the url in it.

If you used a blank url in step one, and you are done moving things, you can now use the config menu item to enter the correct url. Just make sure it is the correct current url of your blog, or you'll be back to step 1 again.

I don't know at what version these new requirements became necessary, as I went directly from 1.3.1 to 1.5.1. I hope this saves someone some frustration.

Richard Cobb
Blacksburg, VA

Re: Moving Flatpress to a new location in 1.5.1

Posted: Sun May 03, 2026 10:56 pm
by fraenkiman
Hi Richard,

Thank you very much for your feedback. This change was implemented in 1.5 Stringendo as part of a security patch.

Here is the section in the changelog (Reflected XSS and host-based URL poisoning / open redirect fixed):

When I get a chance, I’ll put that into a short wiki article.

Best regards,
Frank

Re: Moving Flatpress to a new location in 1.5.1

Posted: Mon May 04, 2026 12:37 am
by winddrifter
I figured there was a good reason for it. Instead of upgrading my 1.3.1 I made a fresh install of 1.5.1. Then, following instructions from the wiki, I copied over the fp-content folder and it blew up. Putting back the original (fresh) fp-content folder it would work again, so I knew it had to be something in that folder.
After going back and forth between the folders, I finally found what I needed to change to make it work. FYI, even knowing the problem, I couldn't solve it by using any of the configuration or setup menus, I would get errors before being able to get to any admin menus. So I couldn't purge cache, edit configuration, etc - I had to edit by hand.
Maybe, instead of copying over the entire fp-content folder in a case like mine, copy the entire folder with the exception of the fp-content/config and /cache files?

Thanks,

Richard

Re: Moving Flatpress to a new location in 1.5.1

Posted: Thu May 07, 2026 6:24 pm
by fraenkiman
Hello winddrifter,

The critical file when moving the FlatPress instance to a new location is fp-content/config/settings.conf.php. This file contains the entire FlatPress configuration, including the blogbase URL. It must be edited manually.
The fp-content/cache/ directory does not need to be moved to the new location. It’s best to delete it beforehand.

Alternatively, you can choose not to move the settings.conf.php file to the new location. However, you must then run the setup to ensure the configuration file is rewritten with the new blogbase URL.

I’m wondering if it makes sense to trigger the setup—where the user can manually adjust the blogbase URL—if the blogbase URL is invalid when index.php is called. ...and now the security researchers are throwing their hands up in horror :o . Perhaps a plain-text note in the browser would suffice.

I’m thinking of a solution for FP 1.6 in case someone else encounters a similar issue.

Best regards,
Frank

Re: Moving Flatpress to a new location in 1.5.1

Posted: Thu May 07, 2026 11:51 pm
by winddrifter
Perhaps a plain-text note in the browser would suffice.
That sounds like a great option that wouldn't compromise security - a message that the base url may need to be updated. That would provide much more useful information than what currently happens:

Code: Select all

Fatal error: Uncaught Error: Failed opening required ... '
:D

Richard

Re: Moving Flatpress to a new location in 1.5.1

Posted: Sun May 10, 2026 3:42 pm
by Docthib
Dear winddrifter / Richard and fraenkiman (fränkiman?),
THANK YOU very much!
I am new to Flatpress, and I wanted to test quite rapidly whether a simple copy of my blog to a new location would work. Your question and answers solved my problem! :D
I am summarizing the process below, for future users ;)
0. Using Filezilla or any FTP program, download the whole flatpress folder to your local drive
1. On the local version, edit \fp-content\config\settings.conf.php - at the top of that file you'll find something like

Code: Select all

$fp_config = array (
  'general' => 
  array (
    'www' => 'http://localhost/blog151',
You'll need to change the www url to the exact url of your blog. You could also make this a blank entry (keep the quote marks) and it would also work. And with the blank url, you can move it anywhere without having to edit this file again.
*Note 1 - trying to set this to blank in the Admin menu (admin.php?p=config), a blank URL is not allowed by the interface. Even with a blank url, you'll still need the next step after moving.

2. The fp-content/cache/ directory does not need to be moved to the new location. You can just delete every file inside this /cache/ directory

3. Now you can upload your folder anywhere with Filezilla (but the website must accept https; free solutions like free.fr in France are still stuck to http pages...)

**Note 2 - once you have a blank url, you can go to the Admin menu (admin.php?p=config) and declare the new blog URL. If it does not correspond to the real address, it will not be accepted.

Sincerely,
Docthib

Re: Moving Flatpress to a new location in 1.5.1

Posted: Sat May 16, 2026 10:22 pm
by fraenkiman
Hello everyone,

I've written a "migration service" for FlatPress 1.6. The migration service is triggered by deleting the %%setup.lock file after you've copied your blog to the new web host.

Details can be found in this PR.

Have a relaxing Sunday, and best regards,
Frank