Broken image links after migrating a Drupal site from the local computer to the server

The easiest way to update image paths after moving a website from a local machine to a live server. In most cases, I finish updating the paths manually. I am convinced that there should be an easier way that I am missing.

Please offer.

+3
source share
5 answers

I assume that the problem you are seeing is the result of not setting the file path in the administration. If you log in to the administration (admin / settings / file-system) and just save the page, you will define a value for the file path (which should fix the problems).

( ), .

, , , _get , settings.php. , .

, , , .

+3

, . - SQL-.   UPDATE SET filepath = REPLACE ( , "/", "/" );

+1

, Acquia Drupal 7 . , , .

,

select * from menu_router where path like '%sites/myoldpath%'

page_callback image_style_deliver, .

update menu_router set path 'sites/mynewpath/files/styles%', tab_root = 'sites/mynewpath/files/styles/%' where path like '%myoldpath%'

. - . Drupal .

+1

dev- dev-. . , , . , , /DOMAIN _NAME/files. -, Drupal .

0

, , - .sql dump , URL-, , , mu drupal , , , 1: 2: sql-. .

3: use search and replace to edit a copy of sql dump file and put the path to url or u want files. In my case, I would like to change the URL prefix of all image links, for example http://my.oldserver.co.uk , to http://newserver.ac.uk . 4 create a new database and import the edited .sql file using the same usernames, usernames and password.

  • return the site online and viola, your image links work.
0
source

Source: https://habr.com/ru/post/1713956/


All Articles