1. Kent Morrison
  2. Tricks
  3. Monday, 22 July 2019
  4.  Subscribe via email
This is not a question, unless someone reading this knows a better way to do this.

Scenario,
Moving (copying) 58 markers (with some custom formatting in the details) from one web site working properly but OLD to another website brand new rewrite that will use the same map.

No export/import known to be available directly from Hotspots PRO to same
SO, a PHPMyAdmin export/import of the data is required

OH YEAH and MAKE A BACKUP before you start, ok ?

I used the following params when getting the export of table (oldprefix)_hotspots_marker

Custom
SQL
all rows
uncheck display comments
check data
uncheck Dump binary...
uncheck Dump TIMESTAMP...

GO
---
file saves as filename (oldprefix)_hotspots_marker.sql

RENAME this file to (newprefix)_hotspots_marker.sql
EDIT this file
Search for all occurrances of (oldprefix)
REPLACE
with (newprefix)
SAVE

NOW you have an import file with the correct name (newprefix)hotspots_marker.sql
that contains lines that either declare INSERT INTO (newprefix)hotspots_marker
OR are the actual data
(9, 0, 93,.....(buncha data fields in here)...............................................0),

I did not use the PHPMyAdmin data export "feature" called "Rename exported databases/tables/columns"
because it is buggy junk and I have wasted too many hours trying to get it to work consistently.
Far faster to simply use a text editor search/replace.

SO now import the (newprefix)hotspots_marker.sql into the new database.

The problem then, is that in order to display on a map, the Category must be valid.
You create a Category in the new database and it will never be the same Category ID # as the old one was.
I even used a different Category name, because the name does not matter at all.
You will simply have to go into the new table and change all of the newly imported items CATID column values to be the new category ID# that you created.

Here is the SQL syntax that I used in the SQL tab in PHPMyAdmin :
UPDATE 'j7na_hotspots_marker' SET catid = 39

WHERE j7na is my new table for new site and
39 is the ID of the new category I created.

YOUR SQL SYntax will vary IF you have already got valid markers in the table that you are importing into.
The above changes ALL records in the table, so you would have to do a SELECT for only the newly imported records' OLD Category ID #, then an UPDATE operation. SImilar to above, but more complex SQL query, something like this:

UPDATE 'j7na_hotspots_marker' set catid = 39
where catid in (SELECT catid from 'j7na_hotspots_marker' where catid is 77);

this example above sets the new catid value to 39 in all records that have an old catid value of 77

Finally
I use Akeeba Admin Tools Pro, so I have an easy to run database table optimizer.
If you must, use the database repair in your hosting cpanel, or in the PhpMyAdmin db view, select all tables and pull down the "With Selected" option to "Optimize Table"
It's a good idea after fiddling with table contents as we have just done.

Then make a new menu of type Hotspots View Map that shows that category of markers.

It all took me about 25 minutes to get it all where it needed to be, but if I had these instructions when I started it would have been more like 7 minutes.
Ended with a pretty new map with the same old markers on a pretty new web site.

Kent Morrison - kent AT steamboat 3d DOT com
Glad to help any Hotspots PRO users, it is a GREAT product !
Responses (4)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

non-canonnical links
comment generates mass non-canonical links like http://zeitung.de/themen/bildung...
5 Replies
Posted on Sunday, 24 November 2024
  • #non canonical
joomla 5 and ccomment
does ccomment also work under joomla 5?...
4 Replies
Posted on Saturday, 30 November 2024
  • New
  • How do you include a custom field and its value in
    How do you include a custom field as one of the fields in the table/list of loca...
    2 Replies
    Posted on Tuesday, 26 November 2024
    Bestäigungs-E-Mails in Endlosschleife
    Hallo Yves, nach erfolgter Buchung in Matukio wird die Bestätigungsmail alle ...
    0 Replies
    Posted on Tuesday, 26 November 2024
    Update von Matukio von 6.0.16 auf 6.1 Fehler bei K
    Hi Matukio Support Team, ich bin gerade dabei eine Intranetseite auf Vordermann...
    3 Replies
    Posted on Thursday, 14 November 2024
    • #Matukio
    • #update
    • #6.1