Results 1 to 8 of 8

Thread: Installing Contao v2.11.11 on localhost

  1. #1
    User
    Join Date
    05-12-14.
    Posts
    72

    Default Installing Contao v2.11.11 on localhost

    Hi.
    So I am trying to install contao version 2.11.11 on localhost so i can test and fix current version offline and test for eventual migration to v3 etc.
    Im on a MAC; so i have Apache running and php installed.

    I use the contao checker and get a problem there saying 'You need Safe Mode Hack'.

    So i open up apache2/httpd.conf and change the

    User _www
    Group _www

    To

    User your_mac_username
    Group staff




    This spits out a whole bunch of code on the install tool accept page, permissions in bootstrap, etc. although it does remove the 'You need Safe Hack'

    But when i try and click on the accept i get an Invalid Token error.
    I tried to set the config.php file line $GLOBALS['TL_CONFIG']['disableRefererCheck'] = true;

    This allowed me to set the install tool login, but then it asks for login password after setting the password and nothing really happens.

    I looked for the session.save_path in the php admin which has no value set. Im guessing i need to change that, but how?


    Now im stuck. But im guessing its something to do with how i have apache configured.
    Any advice on how to fix this?
    Last edited by markclaus; 06/12/2014 at 12:28.

  2. #2
    User
    Join Date
    05-12-14.
    Posts
    72

    Default SOLVED

    Ah ok, i figured this out eventually.

    Changed the permissions in Terminal by:

    sudo chmod -R a+w ~/Sites
    sudo chown -R _www ~/Sites

  3. #3
    User
    Join Date
    05-12-14.
    Posts
    72

    Default Import live site structure to local

    Hi......again....

    So all went well.

    Now I am trying to backup the live site to my localhost.

    So i tried using the DBBackup extension. Exported the sql file with templates as well. imported the sql database and placed the template files in the template folder on my localhost.


    Now i didn't read the Text file that i should have from the DBbackup export, and i am hoping this hasn't messed anything up with the localhost installation of contao........BUT as i did run it before reading the text file i had not downloaded all files and subdirectories but i had installed the extensions.

    Anyway, the import didn't work.
    I get:


    Fatal error: Uncaught exception Exception with message Query error: Duplicate entry '1' for key 'PRIMARY' (INSERT INTO `tl_article` (`id`, `pid`, `sorting`, `tstamp`, `title`, `alias`, `author`, `inColumn`, `keywords`, `showTeaser`, `teaser`, `printable`, `cssID`, `space`, `published`, `start`, `stop`, `teaserCssID`, `languageMain`, `dw_description`) VALUES ( 1, 7, 128, 1282660711, 'Flexible Geschäftsdatenbanken', 'home', 1, 'main', 'Geschäftsdatenbank, Access Ablösung, Excel Datenbank', '', NULL, '', 'a:2:{i:0;s:0:"";i:1;s:0:"";}', 'a:2:{i:0;s:0:"";i:1;s:0:"";}', '1', '', '', 'a:2:{i:0;s:0:"";i:1;s:0:"";}', 0, NULL ) thrown in …/system/libraries/Database.php on line 686
    #0 …/system/libraries/Database.php(633): Database_Statement->query()
    #1 …/system/libraries/Database.php(161): Database_Statement->execute()
    #2 …/contao/install.php(803): Database->execute('INSERT INTO `tl...')
    #3 …/contao/install.php(966): InstallTool->run()
    #4 {main}



    Also the admin details need to be reset, after refreshing the install.php

    When i login to the site, there is nothing in the site structure.
    The templates are there, themes required reloading, images are there of course but no site structure or articles. Maybe i am missing some files from the live site, I am not sure.



    Anybody have any advice at this stage??
    Last edited by markclaus; 06/13/2014 at 09:04.

  4. #4
    User
    Join Date
    05-12-14.
    Posts
    72

    Default

    It has occurred to me that i could just copy the whole of the live website into my localhost.

    Then i guess run the install tool again.

    Is that an option?

  5. #5
    User
    Join Date
    05-12-14.
    Posts
    72

    Default

    Or is this a case of me not having an empty database before importing the DBBackup created sql file?

    From what im reading in the German forums, this may be the case, if my German is understanding German correctly today:roll eyes:

    So delete the existing local DB and import the DB from the live server? Would that remove this problem?

    Cheers

  6. #6
    User
    Join Date
    05-12-14.
    Posts
    72

    Default

    Ok, well thats what i tried, and this worked for me now.

    You know, life is very strange when i have these conversations with myself

  7. #7
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by markclaus View Post
    Or is this a case of me not having an empty database before importing the DBBackup created sql file?
    It depends on what you were trying to import into the database:
    • a full SQL database dump (which includes data and structure) or
    • a so called Contao website template (i.e. which includes only the data and not the DB structure)

    You cannot import a full SQL database dump using the Contao install tool since at this point Contao has already been created the given database structure. To import such a DB dump into an empty database use a database administration system like phpMyAdmin.

    On the other hand, a website template such as created by DBBackup can be imported by the Contao install tool.
    Contao Community Moderator
    → Support options

  8. #8
    User
    Join Date
    05-12-14.
    Posts
    72

    Default

    Yes, I realised all this after the fact
    I was trying to import the site data and structure, so i needed to so create an SQL dump and not a template.

    I initially went about it all in not a very good way. Which i discovered by trial and error.

    Emptying the DB in a fresh install of Contoa, and then importing the SQL database dump (im on mac so...) into Sequel Pro fixed the problems i was encountering.

    When i was trying to import the SQL database dump into the Sequel Pro i was getting a lot of 'cant overwrite' and 'value can't be NULL' errors (can't remember the exact error messages i was getting). Once I'd done a search for information on the DBbackup extension and actually read a bit more about the process, the mistakes i was making became pretty clear.

    One thing i did find, winding my way along this twisty turn path, was that I had installed all the extensions onto the localhost that were present on the live version. After i had finished solving importing the website data and structure i found that i had to uninstall and reinstall all the extensions, as i ended up with duplicate extensions, or the extensions were not showing their menus in the backend. Im pretty sure this is related to my initial attempts to import the database over the original database associated with a fresh install of contao and extensions i needed.

    Anyway, it worked fine in the end.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •