Forum

Thread tagged as: Runway

Importing Perch database to Runway

Hi there,

Two questions regarding Runway upgrade.

1 – Before upgrading Perch to Runway, I forgot to backup my database in production along with the resources folder. The upgrade is now over, I end up now with an outdated local copy of my production site. I believe there would be a conflict if I take a dump of the Perch database and import it in Runway, I just wanted to confirm: any way to save me from re-entering all the data?

2 – Might sound like a silly question but does Runway need a index.php at the root of the site? I was trying to apply the logic of the master pages situated in templates/pages/ – like the other pages – but couldn't find my way with the route to be applied. I ended-up keeping a physical page at the root of the site with include('perch/runtime.php'); it's working fine but I'm just wondering if it's the correct way? Should index.php be also included as master page? If yes, how do you handle the root?

Cheers,

Robin Pick

Robin Pick 5 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

1 - You can download your production database and that will have no record of the update so it will just re-run.

2 - No, you shouldn't have an index page - everything should be routed to master pages.

Thanks for the reply. Regarding the main index.php, which route shall I specify then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your homepage should have a path of /

Here is what I have so far:

  • Page details of index: / is added as a the location path
  • Page details of index: Index is selected as master page in the dropdown list
  • My index.php is located in perch/templates/pages/
  • No route is specified

When I hit the url in the browser, it brings me to the root of the site. If I add / for the url pattern in the Page details, it doesn't work either.

Am I missing something?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you added rewrite rules?

Here is how the .htaccess looks like:

RewriteEngine on

# old rules used for Perch
# RewriteRule ^category/([a-zA-Z0-9-/]+)$ /category.php?cat=$1 [L]
# RewriteRule ^episodes/([a-zA-Z0-9-/]+)$ /episodes.php?s=$1 [L]
# RewriteRule ^campaigns/([a-zA-Z0-9-/]+)$ /campaigns.php?s=$1 [L]
# RewriteRule ^(en|fr)/?$ index.php?lang=$1 [L]

# Runway
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/perch 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /perch/core/runway/start.php [L]
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you've removed your existing pages, take out this line:

RewriteCond %{REQUEST_FILENAME} !-d

Thanks Drew, this worked.