Typo3 4.7 to 9

by copying the database content directly

<?php
error_reporting(-1);
$con = mysqli_connect("localhost","XXXXX","XXXXX","XXXXX");                        //connect to database, connection name $conn
if (!$con) {die('Could not connect: ' . mysqli_error());}                //error if cannot connect


echo "OK";

//fe_groups
mysqli_query($con, "INSERT INTO typo39.fe_groups (
uid, pid, tstamp, crdate, cruser_id, title, hidden ) SELECT
uid, pid, tstamp, crdate, cruser_id, title, hidden
FROM typo3475.fe_groups WHERE uid >= 1 ");
echo "fe_groups OK";

//fe_users
mysqli_query($con, "INSERT INTO typo39.fe_users (
uid, pid, tstamp, username, password, usergroup, disable, starttime, endtime, crdate, cruser_id, deleted, lastlogin, is_online ) SELECT
uid, pid, tstamp, username, password, usergroup, disable, starttime, endtime, crdate, cruser_id, deleted, lastlogin, is_online
FROM typo3475.fe_users WHERE uid >= 1 ");
echo "fe_user OK";

//pages
mysqli_query($con, "INSERT INTO typo39.pages (
uid, pid, tstamp, sorting, deleted, perms_userid, perms_groupid, perms_user, perms_group, perms_everybody, cruser_id, hidden, title, doktype, shortcut, fe_group, subtitle, keywords, description, SYS_LASTCHANGED, abstract, nav_title, nav_hide, backend_layout ) SELECT
uid, pid, tstamp, sorting, deleted, perms_userid, perms_groupid, perms_user, perms_group, perms_everybody, cruser_id, hidden, title, doktype, shortcut, fe_group, subtitle, keywords, description, SYS_LASTCHANGED, abstract, nav_title, nav_hide, 'pagets__inner'
FROM typo3475.pages WHERE uid >= 1 ");
echo "pages OK";

/*
//sys_domain
mysqli_query($con, "INSERT INTO typo39.sys_domain (
uid, pid, tstamp, crdate, cruser_id, domainName, sorting ) SELECT
uid, pid, tstamp, crdate, cruser_id, domainName, sorting
FROM typo3475.sys_domain WHERE uid >= 1 ");
echo "sys_domain OK";
*/

//tt_content
mysqli_query($con, "INSERT INTO typo39.tt_content (
uid, pid, tstamp, crdate, cruser_id, hidden, sorting, CType, header, bodytext, imagewidth, imageorient, imagecols, imageborder, deleted, colPos, header_link, image_zoom, list_type, sectionIndex, imageheight, sys_language_uid ) SELECT
uid, pid, tstamp, crdate, cruser_id, hidden, sorting, CType, header, bodytext, imagewidth, imageorient, imagecols, imageborder, deleted, colPos, header_link, image_zoom, list_type, sectionIndex, imageheight, sys_language_uid
FROM typo3475.tt_content WHERE uid >= 1 ");
echo "tt_content OK";

printf("Error message: %s\n", $con->error);

/*
 * Columns that did not work , or that are not available in the typo39 version:
imagecaption
imagecaption_position
image_link
altText
titleText
longdescURL
image            image is int with relation to sys_file in typo39 and was char with filename in typo3475!
media            cannot be NULL
*/

?>