testing new domain

Discussion in 'Installation' started by webproxylists, Jun 23, 2014.

  1. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    Hi

    Ive been testing how to move amember to a new host and domain ...

    Ive successfully managed into move everything and change all config files etc ... however

    when I login to amember admin it loads the old site url admin and if i page back< it loads the new one and lets me login ... when I log out again it gives me the old url ... the same with wordpress admin login and logout ...

    Im assuming there are references to the old url in the MYSQL database ... can you advise how to fix this
  2. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    ok ive now run the following and replaced all reference to the old site

    "<?php
    // Connect to your MySQL database.
    $hostname = "localhost";
    $username = "username";
    $password = "password";
    $database = "databasename";

    mysql_connect($hostname, $username, $password);

    // The find and replace strings.
    $find = "words to find";
    $replace = "replacement words";

    $loop = mysql_query("
    SELECT
    concat('UPDATE ',table_schema,'.',table_name, ' SET ',column_name, '=replace(',column_name,', ''{$find}'', ''{$replace}'');') AS s
    FROM
    information_schema.columns
    WHERE
    table_schema = '{$database}'")
    or die ('Cant loop through dbfields: ' . mysql_error());

    while ($query = mysql_fetch_assoc($loop))
    {
    mysql_query($query['s']);
    }"

    But now im getting this url when i login or out of members admin 404
    url/members/admin-auth/:///members/admin/
  3. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    i assume ive inadvertently changed something ... can you point me in the right direction please :)
  4. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Did you reinstall aMember or copy everything from old domain?

    If you copied it did you also simply copy the htaccess file also?
  5. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    i used backupbuddy for wordpress, it copies everything
  6. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    if I dont change the old site references in the restored DB when you enter the admin password and username for amember it takes you to the login for the old site, if you go back in the browser it then takes you logged in to the new site, when you logout the same happens, it takes you to the old site ...

    when I change all the references to the old site, login/logout takes you to a 404 error ...and this is in the address bar (myurl)/members/admin-auth/:///members/admin/
  7. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    ok ive narrowed it down to am_config ...

    Ive done a clean install then dropped all the tables in the DB bar am_config
    then imported all from the old site except am_config .... the only thing is it lost the word press details other than that so far so good ???

    does no one have a definitive step by step to move amemeber running from wordpress ?
  8. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    all seems good but ive just notice the currency has reverted back to USD instead of GBP ? how do i change this ...nb there are invoices in the DB ... do I need to remove these 1st ?
  9. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Yes you can, if only I could remember! It involves changing one of the core files that checks if Invoices are present so that it doesn't check, you can then change the default currency and then change back the core file. I'll have a look back in my notes later today and see if I added it there.

    Another workaround would be to create a new database, rename am-config so aMember creates a new config file that points to this new database. Now run aMember installation again and it should tell you you it needs configuration. Let it configure itself as if it was a completely new installation. In Global setup set the base currency, this is stored in a file if I remember correctly.

    Once your 'new' installation has been configured rename the old config file, the one that holds login details for the proper database and you should find everything works but with the new base currency.

    Above should take 15 mins or so maximum.

    Other alternative is to ask aMember support which file needs to be changed temporarily.
  10. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Right!!

    Edit file
    amember/library/Am/Form/Standard.php
    and replace lines

    PHP:
    if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice"))
     
    $currency->toggleFrozen(true);
    to
    PHP:
     
    // if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice"))
     
    // $currency->toggleFrozen(true);
     
    Change back afterwards.

    (Did it back in 2012 so presume file name/content still the same.)

    Hope that helps.
    webproxylists likes this.
  11. webproxylists

    webproxylists New Member

    Joined:
    Mar 29, 2013
    Messages:
    28
    many thanks, i found this after much digging on the net :) and much pulling of my hair out ...
    :)

Share This Page