SirJune  
                (Sir June)
               
                 
              
                  
                    October 7, 2019,  9:27pm
                   
                   
              1 
               
             
            
              I am trying to move a dashboard from the default space to another.  following this blog (https://www.elastic.co/blog/how-to-migrate-to-kibana-spaces )
[root@vm21:/etc/kibana ] $ curl -k -u elastic:somepassword https://vm21:5601/app/kibana#/dashboard/0ced9280-e937-11e9-8780-d10befb3ed2b  > export.json
it created the a file export.json
I then tried to import: 
curl -k -H "Content-Type: application/json" -H "kbn-xsrf: true" -u elastic:somepasswprd https://vm21:5601/s/testspace1/app/kibana/import  --data-binary @export.json 
got a response: 
{"statusCode":404,"error":"Not Found","message":"Not Found"}
i also tried this: 
curl -k -H "Content-Type: application/json" -H "kbn-xsrf: true" -u elastic:somepassword https://vm21:5601/s/testspace1/api/kibana/dashboards/import  --data-binary @export.json 
got a response: 
{"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}[root@vm21:/etc/kibana ] $
I'd appreciate any help/tips.
thanks, 
sirjune
             
            
               
               
               
            
            
           
          
            
            
              how did you received the dashboard id number?
I have done this via API many time over with different combination. never done it via command line
             
            
               
               
               
            
            
           
          
            
              
                stephenb  
                (Stephen Brown)
               
              
                  
                    October 7, 2019, 11:54pm
                   
                   
              3 
               
             
            
              I think perhaps you are calling the export API  incorrectly
Looks like you are missing the export part of the path?
Also looks like you have dashboard singular instead of dashboards
The API may have changed slight over versions
curl -X GET "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c" -H 'kbn-xsrf: true'
             
            
               
               
               
            
            
           
          
            
              
                SirJune  
                (Sir June)
               
              
                  
                    October 8, 2019,  3:07pm
                   
                   
              4 
               
             
            
              @elasticforme : i followed the blog i mentioned in the original post
@stephenb : you're correct. i missed some in the command line. tired eyes yesterday. 
these allowed me to export/import the dashboard to another space.
when i login as testuser (who i gave access to testspace1). It loads the dashboard but a box pops out (lower right corner) with "Unable to update UI setting. Request failed with status code: 403"
             
            
               
               
               
            
            
           
          
            
            
              nice it works for me. I just created bash script which can do that backup. sorry for hijacking thread
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    November 5, 2019,  7:35pm
                   
                   
              6 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.