Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:11:36+00:00 2026-06-03T02:11:36+00:00

This is my first time transferring my local dev site to another local site

  • 0

This is my first time transferring my local dev site to another local site to test out, and can’t access the database in the new site. Both computers are running XAMPP on Macs. The test site has successfully installed XAMPP, and has placed database files under Applications/XAMPP/xamppfiles/var/mysql. The test user is able to start Apache and MySQL, and see database files in PHPMyAdmin. The test user is also able to access the local web site with no error messages.

EDIT: The database files were copied over by copying/zipping the file on my end, and unzipping/dropping the copied files on the test end.

However, the local web site does not seem to see the database. Pages that are supposed to return data just show the default “sorry, we’re sold out” message or show “image not found” graphics, and the admin is unable to log in.

The index page calls

include_once "common/base.php";

which consists of

<?php
// Set the error reporting level
error_reporting(E_ALL);
ini_set("display_errors", 1);

// Start a PHP session   
session_start();
$_SESSION['docroot'] = $_SERVER['DOCUMENT_ROOT'] . '/mysite/';

// Include site constants
include_once $_SERVER['DOCUMENT_ROOT'] . "/inc/constants.inc.php";

    if ( !isset($_SESSION['token']) )
{
    $_SESSION['token'] = md5(uniqid(rand(), TRUE));
    $_SESSION['token_time'] = time();
}

// Create a database object
try {
    $dsn = "mysql:host=".DB_HOST.";dbname=".DB_NAME;
    $_db = new PDO($dsn, DB_USER, DB_PASS);
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
    exit;
}
?>

If there was a connection problem, I would expect to see an error message returned, which I can verify by changing the constants in inc/constants.inc.php to bogus values. So I don’t believe there’s a connection problem.

If you were in my position, what would you check?

EDIT: I just found out about the Export function in PHPMyAdmin. I’m going to try deleting the db files that were copied over, exporting the files from PHPMyAdmin, and then importing them in the test machine.

EDIT: I just had the test machine do a simple

$sql = "SELECT FirstName From users";

    $stmt = $_db->prepare($sql);
    $stmt->execute();
    $aaData = array();

    while($row = $stmt->fetch(PDO::FETCH_NUM)){
    $aaData[] = $row;
    }

    $stmt->closeCursor();

print_r($aaData);

on the index page, it shows the correct list of users. So the connection is good,
and there’s an issue elsewhere. Would y’all say that I still need to delete the copied db and use the “correct” way (export/import), or is that a waste of time?

FINAL EDIT: I did redo the move using Export/Import and everything is working well now. Thanks to all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:11:37+00:00Added an answer on June 3, 2026 at 2:11 am

    First off, zipping files in the mysql data directory and moving them is not the best way to go. It can work if you have completely flushed/shut down the mysql server before moving them. You are better off using mysqldump or a similar tool to move entire databases at a time.

    It sounds to me like you moved over your app’s database files, but you probably forgot to add the user/password credentials to the new MySQL setup. You mentioned you use phpMyAdmin, so when you login on the other machine click the “Privileges” tab and make sure it matches up with the Privileges tab on your dev machine.

    If it’s not that, then it is entirely likely that by zipping and copying the files some/all of the tables were corrupted. Try using phpMyAdmin’s Export and Import capabilities to move the database over. If the data is very large let me know and I can give you some command line entries to run.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when I access any page of my ASP.NET MVC website first time, then this
I am new to databases, in fact this is first time. I want to
I am doing this first time so I need some help. I am using
This is first time I am doing a project in other then English Language
This is my first time I ever created an air installer. When I clicked
This is my first time building an iOS project using any kind of advanced
This is my first time attempting to call an ASP.NET page method from jQuery.
This is my first time using joomla. I don't know if I'm using the
This is my first time with Web services. I have to develop web services
this is my first time posting here, I have a question which I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.